@datocms/astro 0.1.1 → 0.1.3

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.
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  import type { ResponsiveImageType } from "../../lib/types";
3
3
  import { buildSrcSet } from './buildSrcSet';
4
+ import type { JSX } from 'astro/jsx-runtime';
4
5
 
5
- type StyleAttribute = astroHTML.JSX.HTMLAttributes['style'];
6
+ type StyleAttribute = JSX.HTMLAttributes['style'];
6
7
  type StyleAttributeAsObject = Exclude<StyleAttribute, string>;
7
8
 
8
9
  interface Props {
@@ -47,7 +48,7 @@ const {
47
48
  imgClass,
48
49
  imgStyle,
49
50
  priority,
50
- usePlaceholder,
51
+ usePlaceholder = true,
51
52
  sizes,
52
53
  srcSetCandidates,
53
54
  } = Astro.props;
@@ -0,0 +1,2 @@
1
+ import Component from "./index.astro";
2
+ export default Component;
@@ -1,5 +1,4 @@
1
1
  ---
2
- import "@mux/mux-player";
3
2
  import type { Video } from "../../lib/types";
4
3
  import type {
5
4
  CmcdTypes,
@@ -13,10 +12,11 @@ import type MuxPlayerElement from "@mux/mux-player";
13
12
  import type { Tokens } from "@mux/mux-player";
14
13
  import { useVideoPlayer } from "../../lib";
15
14
  import { toHTMLAttrs } from "./toHtmlArgs";
15
+ import type { JSX } from 'astro/jsx-runtime';
16
16
 
17
17
  type ValueOf<T> = T[keyof T];
18
18
 
19
- type StyleAttribute = astroHTML.JSX.HTMLAttributes["style"];
19
+ type StyleAttribute = JSX.HTMLAttributes["style"];
20
20
 
21
21
  interface Props {
22
22
  data: Video;
@@ -99,3 +99,7 @@ const computedProps = {
99
99
  stream-type="on-demand"
100
100
  {...toHTMLAttrs(computedProps)}
101
101
  {...toHTMLAttrs(otherProps)}></mux-player>
102
+
103
+ <script>
104
+ import "@mux/mux-player";
105
+ </script>
@@ -0,0 +1,2 @@
1
+ import Component from "./index.astro";
2
+ export default Component;
package/lib/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as Image } from "../components/Image/index.astro";
2
- export { default as VideoPlayer } from "../components/VideoPlayer/index.astro";
1
+ export { default as Image } from "../components/Image";
2
+ export { default as VideoPlayer } from "../components/VideoPlayer";
3
3
  export { useVideoPlayer } from './useVideoPlayer';
4
4
 
package/package.json CHANGED
@@ -1,56 +1,51 @@
1
1
  {
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
- }
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.3",
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
+ "./VideoPlayer": "./components/VideoPlayer/index.ts",
26
+ "./Image": "./components/Image/index.ts"
27
+ },
28
+ "engines": {
29
+ "node": ">=18.0.0"
30
+ },
31
+ "files": ["components", "lib"],
32
+ "scripts": {},
33
+ "dependencies": {
34
+ "@astrojs/check": "^0.9.1",
35
+ "typescript": "^5.5.4"
36
+ },
37
+ "peerDependencies": {
38
+ "@mux/mux-player": "*",
39
+ "astro": "*"
40
+ },
41
+ "peerDependenciesMeta": {
42
+ "@mux/mux-player": {
43
+ "optional": true
44
+ }
45
+ },
46
+ "devDependencies": {
47
+ "@mux/mux-player": "*",
48
+ "@mux/playback-core": "^0.25.1",
49
+ "astro": "^4.13.1"
50
+ }
56
51
  }
package/lib/astro.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /// <reference types="astro/client" />
2
-
3
- declare module "*.astro" {
4
- type Props = any;
5
- const Component: (props: Props) => any;
6
-
7
- export default Component;
8
- export type { Props };
9
- }
package/lib/utils.ts DELETED
@@ -1,3 +0,0 @@
1
- export function foobar() {
2
- return true;
3
- }