sanity-plugin-shopify-assets 1.2.3 → 2.0.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/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/index.d.ts +49 -61
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +477 -713
- package/dist/index.js.map +1 -1
- package/package.json +44 -75
- package/dist/index.esm.js +0 -859
- package/dist/index.esm.js.map +0 -1
- package/sanity.json +0 -8
- package/src/components/AssetDiff.tsx +0 -59
- package/src/components/AssetPreview.tsx +0 -75
- package/src/components/DialogHeader.tsx +0 -44
- package/src/components/File.styled.tsx +0 -60
- package/src/components/File.tsx +0 -54
- package/src/components/ShopifyAssetInput.styled.tsx +0 -13
- package/src/components/ShopifyAssetInput.tsx +0 -84
- package/src/components/ShopifyAssetPicker.tsx +0 -207
- package/src/components/ShopifyIcon.tsx +0 -22
- package/src/components/VideoPlayer.tsx +0 -50
- package/src/datastores/shopify.ts +0 -93
- package/src/index.ts +0 -33
- package/src/sanity-ui.d.ts +0 -6
- package/src/schema/shopifyAssetMetadataSchema.ts +0 -34
- package/src/schema/shopifyAssetPreviewSchema.ts +0 -24
- package/src/schema/shopifyAssetSchema.ts +0 -88
- package/src/types.ts +0 -54
- package/src/utils/helpers.ts +0 -1
- package/v2-incompatible.js +0 -11
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -69,14 +69,14 @@ defineField({
|
|
|
69
69
|
"alt": "",
|
|
70
70
|
"width": 3169,
|
|
71
71
|
"height": 3169,
|
|
72
|
-
"duration": 60 // video only
|
|
72
|
+
"duration": 60, // video only
|
|
73
73
|
},
|
|
74
74
|
"preview": {
|
|
75
75
|
"url": "https://cdn.shopify.com/s/files/1/0555/4906/7569/files/Green_1.jpg?v=1665668073",
|
|
76
76
|
"width": 3169,
|
|
77
|
-
"height": 3169
|
|
77
|
+
"height": 3169,
|
|
78
78
|
},
|
|
79
|
-
"filename": "Green_1.jpg"
|
|
79
|
+
"filename": "Green_1.jpg",
|
|
80
80
|
}
|
|
81
81
|
```
|
|
82
82
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,73 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare interface Asset extends ShopifyFile {
|
|
5
|
-
_type?: string
|
|
6
|
-
_key?: string
|
|
7
|
-
filename?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export declare interface AssetMeta {
|
|
11
|
-
alt?: string
|
|
12
|
-
duration?: number
|
|
13
|
-
fileSize?: number
|
|
14
|
-
height?: number
|
|
15
|
-
width?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export declare interface AssetPreviewImage {
|
|
19
|
-
height: number
|
|
20
|
-
url: string
|
|
21
|
-
width: number
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export declare interface ObjectSchemaWithOptions extends ObjectSchemaType {
|
|
25
|
-
options: {
|
|
26
|
-
shopifyDomain: string
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export declare interface PageInfo {
|
|
31
|
-
hasNextPage: boolean
|
|
32
|
-
cursor: string
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare interface PluginConfig {
|
|
1
|
+
import { ObjectDefinition, ObjectSchemaType } from "sanity";
|
|
2
|
+
interface PluginConfig {
|
|
36
3
|
/**
|
|
37
4
|
* Your *.myshopify.com domain. Do not include https:// or any path.
|
|
38
5
|
*/
|
|
39
|
-
shopifyDomain: string
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
declare type PossibleFileTypes = 'file' | 'image' | 'video'
|
|
43
|
-
|
|
44
|
-
export declare interface ShopifyAPIResponse {
|
|
45
|
-
pageInfo: PageInfo
|
|
46
|
-
assets: ShopifyFile[]
|
|
6
|
+
shopifyDomain: string;
|
|
47
7
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
url: string
|
|
8
|
+
interface ObjectSchemaWithOptions extends ObjectSchemaType {
|
|
9
|
+
options: {
|
|
10
|
+
shopifyDomain: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type PossibleFileTypes = 'file' | 'image' | 'video';
|
|
14
|
+
interface AssetPreviewImage {
|
|
15
|
+
height: number;
|
|
16
|
+
url: string;
|
|
17
|
+
width: number;
|
|
18
|
+
}
|
|
19
|
+
interface AssetMeta {
|
|
20
|
+
alt?: string;
|
|
21
|
+
duration?: number;
|
|
22
|
+
fileSize?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
width?: number;
|
|
25
|
+
}
|
|
26
|
+
interface ShopifyFile {
|
|
27
|
+
meta: AssetMeta;
|
|
28
|
+
preview: AssetPreviewImage;
|
|
29
|
+
id: string;
|
|
30
|
+
type: PossibleFileTypes;
|
|
31
|
+
url: string;
|
|
32
|
+
}
|
|
33
|
+
interface Asset extends ShopifyFile {
|
|
34
|
+
_type?: string;
|
|
35
|
+
_key?: string;
|
|
36
|
+
filename?: string;
|
|
37
|
+
}
|
|
38
|
+
interface PageInfo {
|
|
39
|
+
hasNextPage: boolean;
|
|
40
|
+
cursor: string;
|
|
41
|
+
}
|
|
42
|
+
interface ShopifyAPIResponse {
|
|
43
|
+
pageInfo: PageInfo;
|
|
44
|
+
assets: ShopifyFile[];
|
|
57
45
|
}
|
|
58
|
-
|
|
59
|
-
export {}
|
|
60
|
-
|
|
61
46
|
declare module 'sanity' {
|
|
62
47
|
namespace Schema {
|
|
63
48
|
type ShopifyAssetTypeDef = Omit<ObjectDefinition, 'type' | 'fields'> & {
|
|
64
|
-
type: 'shopify.asset'
|
|
65
|
-
options
|
|
66
|
-
shopifyDomain
|
|
67
|
-
}
|
|
68
|
-
}
|
|
49
|
+
type: 'shopify.asset';
|
|
50
|
+
options?: {
|
|
51
|
+
shopifyDomain?: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
69
54
|
interface IntrinsicTypeDefinition {
|
|
70
|
-
'shopify.asset': ShopifyAssetTypeDef
|
|
55
|
+
'shopify.asset': ShopifyAssetTypeDef;
|
|
71
56
|
}
|
|
72
57
|
}
|
|
73
58
|
}
|
|
59
|
+
declare const shopifyAssets: import("sanity").Plugin<PluginConfig>;
|
|
60
|
+
export { Asset, AssetMeta, AssetPreviewImage, ObjectSchemaWithOptions, PageInfo, PluginConfig, ShopifyAPIResponse, ShopifyFile, shopifyAssets };
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";UAEiB,YAAA;EAAA;;;EAIf,aAAa;AAAA;AAAA,UAGE,uBAAA,SAAgC,gBAAgB;EAC/D,OAAA;IACE,aAAA;EAAA;AAAA;AAAA,KAIC,iBAAA;AAAA,UAEY,iBAAA;EACf,MAAA;EACA,GAAA;EACA,KAAA;AAAA;AAAA,UAGe,SAAA;EACf,GAAA;EACA,QAAA;EACA,QAAA;EACA,MAAA;EACA,KAAA;AAAA;AAAA,UAGe,WAAA;EACf,IAAA,EAAM,SAAA;EACN,OAAA,EAAS,iBAAA;EACT,EAAA;EACA,IAAA,EAAM,iBAAA;EACN,GAAA;AAAA;AAAA,UAGe,KAAA,SAAc,WAAW;EACxC,KAAA;EACA,IAAA;EACA,QAAA;AAAA;AAAA,UAGe,QAAA;EACf,WAAA;EACA,MAAM;AAAA;AAAA,UAGS,kBAAA;EACf,QAAA,EAAU,QAAA;EACV,MAAA,EAAQ,WAAW;AAAA;AAAA;EAAA,UCzCF,MAAA;IAAA,KAGH,mBAAA,GAAsB,IAAA,CAAK,gBAAA;MACrC,IAAA;MACA,OAAA;QACE,aAAA;MAAA;IAAA;IAAA,UAIa,uBAAA;MACf,eAAA,EAAiB,mBAAA;IAAA;EAAA;AAAA;AAAA,cAKV,aAAA,mBAAa,MAAA,CAAA,YAAA"}
|