@sanity/dashboard 0.136.3-purple-unicorn-patch.5627
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 +21 -0
- package/README.md +118 -0
- package/lib/cjs/DashboardTool.js +59 -0
- package/lib/cjs/components/DashboardLayout.js +35 -0
- package/lib/cjs/components/NotFoundWidget.js +53 -0
- package/lib/cjs/components/WidgetGroup.js +71 -0
- package/lib/cjs/components/dashboardWidget.js +55 -0
- package/lib/cjs/containers/Dashboard.js +32 -0
- package/lib/cjs/containers/WidgetContainer.js +52 -0
- package/lib/cjs/dashboardConfig.js +16 -0
- package/lib/cjs/legacyParts.js +55 -0
- package/lib/cjs/versionedClient.js +20 -0
- package/lib/cjs/widget.css +62 -0
- package/lib/cjs/widgets/projectInfo/ProjectInfo.js +269 -0
- package/lib/cjs/widgets/projectInfo/index.js +19 -0
- package/lib/cjs/widgets/projectUsers/ProjectUsers.js +194 -0
- package/lib/cjs/widgets/projectUsers/index.js +16 -0
- package/lib/cjs/widgets/sanityTutorials/SanityTutorials.js +122 -0
- package/lib/cjs/widgets/sanityTutorials/Tutorial.js +114 -0
- package/lib/cjs/widgets/sanityTutorials/dataAdapter.js +28 -0
- package/lib/cjs/widgets/sanityTutorials/index.js +19 -0
- package/lib/dts/src/DashboardTool.d.ts +11 -0
- package/lib/dts/src/DashboardTool.d.ts.map +1 -0
- package/lib/dts/src/DashboardTool.js +18 -0
- package/lib/dts/src/DashboardTool.js.map +1 -0
- package/lib/dts/src/components/DashboardLayout.d.ts +13 -0
- package/lib/dts/src/components/DashboardLayout.d.ts.map +1 -0
- package/lib/dts/src/components/DashboardLayout.js +15 -0
- package/lib/dts/src/components/DashboardLayout.js.map +1 -0
- package/lib/dts/src/components/NotFoundWidget.d.ts +16 -0
- package/lib/dts/src/components/NotFoundWidget.d.ts.map +1 -0
- package/lib/dts/src/components/NotFoundWidget.js +29 -0
- package/lib/dts/src/components/NotFoundWidget.js.map +1 -0
- package/lib/dts/src/components/WidgetGroup.d.ts +3 -0
- package/lib/dts/src/components/WidgetGroup.d.ts.map +1 -0
- package/lib/dts/src/components/WidgetGroup.js +81 -0
- package/lib/dts/src/components/WidgetGroup.js.map +1 -0
- package/lib/dts/src/components/dashboardWidget.d.ts +9 -0
- package/lib/dts/src/components/dashboardWidget.d.ts.map +1 -0
- package/lib/dts/src/components/dashboardWidget.js +48 -0
- package/lib/dts/src/components/dashboardWidget.js.map +1 -0
- package/lib/dts/src/containers/Dashboard.d.ts +3 -0
- package/lib/dts/src/containers/Dashboard.d.ts.map +1 -0
- package/lib/dts/src/containers/Dashboard.js +14 -0
- package/lib/dts/src/containers/Dashboard.js.map +1 -0
- package/lib/dts/src/containers/WidgetContainer.d.ts +13 -0
- package/lib/dts/src/containers/WidgetContainer.d.ts.map +1 -0
- package/lib/dts/src/containers/WidgetContainer.js +42 -0
- package/lib/dts/src/containers/WidgetContainer.js.map +1 -0
- package/lib/dts/src/dashboardConfig.d.ts +7 -0
- package/lib/dts/src/dashboardConfig.d.ts.map +1 -0
- package/lib/dts/src/dashboardConfig.js +4 -0
- package/lib/dts/src/dashboardConfig.js.map +1 -0
- package/lib/dts/src/legacyParts.d.ts +8 -0
- package/lib/dts/src/legacyParts.d.ts.map +1 -0
- package/lib/dts/src/legacyParts.js +10 -0
- package/lib/dts/src/legacyParts.js.map +1 -0
- package/lib/dts/src/versionedClient.d.ts +8 -0
- package/lib/dts/src/versionedClient.d.ts.map +1 -0
- package/lib/dts/src/versionedClient.js +9 -0
- package/lib/dts/src/versionedClient.js.map +1 -0
- package/lib/dts/src/widgets/projectInfo/ProjectInfo.d.ts +31 -0
- package/lib/dts/src/widgets/projectInfo/ProjectInfo.d.ts.map +1 -0
- package/lib/dts/src/widgets/projectInfo/ProjectInfo.js +155 -0
- package/lib/dts/src/widgets/projectInfo/ProjectInfo.js.map +1 -0
- package/lib/dts/src/widgets/projectInfo/index.d.ts +10 -0
- package/lib/dts/src/widgets/projectInfo/index.d.ts.map +1 -0
- package/lib/dts/src/widgets/projectInfo/index.js +7 -0
- package/lib/dts/src/widgets/projectInfo/index.js.map +1 -0
- package/lib/dts/src/widgets/projectUsers/ProjectUsers.d.ts +20 -0
- package/lib/dts/src/widgets/projectUsers/ProjectUsers.d.ts.map +1 -0
- package/lib/dts/src/widgets/projectUsers/ProjectUsers.js +108 -0
- package/lib/dts/src/widgets/projectUsers/ProjectUsers.js.map +1 -0
- package/lib/dts/src/widgets/projectUsers/index.d.ts +7 -0
- package/lib/dts/src/widgets/projectUsers/index.d.ts.map +1 -0
- package/lib/dts/src/widgets/projectUsers/index.js +6 -0
- package/lib/dts/src/widgets/projectUsers/index.js.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/SanityTutorials.d.ts +21 -0
- package/lib/dts/src/widgets/sanityTutorials/SanityTutorials.d.ts.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/SanityTutorials.js +61 -0
- package/lib/dts/src/widgets/sanityTutorials/SanityTutorials.js.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/Tutorial.d.ts +21 -0
- package/lib/dts/src/widgets/sanityTutorials/Tutorial.d.ts.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/Tutorial.js +84 -0
- package/lib/dts/src/widgets/sanityTutorials/Tutorial.js.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/dataAdapter.d.ts +6 -0
- package/lib/dts/src/widgets/sanityTutorials/dataAdapter.d.ts.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/dataAdapter.js +16 -0
- package/lib/dts/src/widgets/sanityTutorials/dataAdapter.js.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/index.d.ts +10 -0
- package/lib/dts/src/widgets/sanityTutorials/index.d.ts.map +1 -0
- package/lib/dts/src/widgets/sanityTutorials/index.js +7 -0
- package/lib/dts/src/widgets/sanityTutorials/index.js.map +1 -0
- package/lib/dts/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/DashboardTool.js +33 -0
- package/lib/esm/components/DashboardLayout.js +23 -0
- package/lib/esm/components/NotFoundWidget.js +39 -0
- package/lib/esm/components/WidgetGroup.js +54 -0
- package/lib/esm/components/dashboardWidget.js +38 -0
- package/lib/esm/containers/Dashboard.js +19 -0
- package/lib/esm/containers/WidgetContainer.js +39 -0
- package/lib/esm/dashboardConfig.js +9 -0
- package/lib/esm/legacyParts.js +9 -0
- package/lib/esm/versionedClient.js +11 -0
- package/lib/esm/widget.css +62 -0
- package/lib/esm/widgets/projectInfo/ProjectInfo.js +254 -0
- package/lib/esm/widgets/projectInfo/index.js +8 -0
- package/lib/esm/widgets/projectUsers/ProjectUsers.js +174 -0
- package/lib/esm/widgets/projectUsers/index.js +5 -0
- package/lib/esm/widgets/sanityTutorials/SanityTutorials.js +108 -0
- package/lib/esm/widgets/sanityTutorials/Tutorial.js +98 -0
- package/lib/esm/widgets/sanityTutorials/dataAdapter.js +16 -0
- package/lib/esm/widgets/sanityTutorials/index.js +8 -0
- package/package.json +55 -0
- package/sanity.json +59 -0
- package/src/DashboardTool.js +32 -0
- package/src/components/DashboardLayout.js +22 -0
- package/src/components/NotFoundWidget.js +41 -0
- package/src/components/WidgetGroup.js +97 -0
- package/src/components/dashboardWidget.tsx +70 -0
- package/src/containers/Dashboard.js +20 -0
- package/src/containers/WidgetContainer.js +52 -0
- package/src/dashboardConfig.js +3 -0
- package/src/legacyParts.ts +11 -0
- package/src/versionedClient.js +9 -0
- package/src/widget.css +62 -0
- package/src/widgets/projectInfo/ProjectInfo.js +232 -0
- package/src/widgets/projectInfo/index.js +7 -0
- package/src/widgets/projectUsers/ProjectUsers.js +179 -0
- package/src/widgets/projectUsers/index.js +6 -0
- package/src/widgets/sanityTutorials/SanityTutorials.js +91 -0
- package/src/widgets/sanityTutorials/Tutorial.js +120 -0
- package/src/widgets/sanityTutorials/dataAdapter.js +17 -0
- package/src/widgets/sanityTutorials/index.js +7 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default ProjectInfo;
|
|
2
|
+
declare class ProjectInfo extends React.PureComponent<any, any, any> {
|
|
3
|
+
static propTypes: {
|
|
4
|
+
__experimental_before: PropTypes.Requireable<any[]>;
|
|
5
|
+
data: PropTypes.Requireable<any[]>;
|
|
6
|
+
};
|
|
7
|
+
static defaultProps: {
|
|
8
|
+
__experimental_before: never[];
|
|
9
|
+
data: never[];
|
|
10
|
+
};
|
|
11
|
+
constructor(props: any);
|
|
12
|
+
constructor(props: any, context: any);
|
|
13
|
+
state: {
|
|
14
|
+
studioHost: null;
|
|
15
|
+
graphqlApi: null;
|
|
16
|
+
};
|
|
17
|
+
componentDidMount(): void;
|
|
18
|
+
subscriptions: any[] | undefined;
|
|
19
|
+
componentWillUnmount(): void;
|
|
20
|
+
assembleTableRows(): {
|
|
21
|
+
title: string;
|
|
22
|
+
rows: {
|
|
23
|
+
title: string;
|
|
24
|
+
value: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
}[];
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
import React from "react";
|
|
30
|
+
import PropTypes from "prop-types";
|
|
31
|
+
//# sourceMappingURL=ProjectInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectInfo.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/projectInfo/ProjectInfo.js"],"names":[],"mappings":";AA2BA;IACE;;;MAIC;IACD;;;MAIC;IAmMm2Z,wBAA8C;IAAA,sCAAyJ;IAjM3ia;;;MAGC;IAED,0BA4CC;IA1CC,iCAAuB;IA4CzB,6BAEC;IAED;;;;;;QAmDC;IAED,sBAiFC;CACF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/* eslint-disable react/forbid-prop-types, no-console */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { isPlainObject } from 'lodash';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { Box, Card, Stack, Heading, Grid, Label, Text, Code, Button } from '@sanity/ui';
|
|
6
|
+
import { versionedClient } from '../../versionedClient';
|
|
7
|
+
import { DashboardWidget } from '../../DashboardTool';
|
|
8
|
+
import { WidgetContainer } from '../../legacyParts';
|
|
9
|
+
const { projectId, dataset } = versionedClient.config();
|
|
10
|
+
function isUrl(url) {
|
|
11
|
+
return /^https?:\/\//.test(`${url}`);
|
|
12
|
+
}
|
|
13
|
+
function getGraphQlUrl() {
|
|
14
|
+
return `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
|
|
15
|
+
}
|
|
16
|
+
function getGroqUrl() {
|
|
17
|
+
return `https://${projectId}.api.sanity.io/v1/groq/${dataset}`;
|
|
18
|
+
}
|
|
19
|
+
function getManageUrl() {
|
|
20
|
+
return `https://manage.sanity.io/projects/${projectId}`;
|
|
21
|
+
}
|
|
22
|
+
class ProjectInfo extends React.PureComponent {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.state = {
|
|
26
|
+
studioHost: null,
|
|
27
|
+
graphqlApi: null,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
componentDidMount() {
|
|
31
|
+
// fetch project data
|
|
32
|
+
this.subscriptions = [];
|
|
33
|
+
this.subscriptions.push(versionedClient.observable.request({ uri: `/projects/${projectId}` }).subscribe({
|
|
34
|
+
next: (result) => {
|
|
35
|
+
const { studioHost } = result;
|
|
36
|
+
this.setState({ studioHost: studioHost ? `https://${studioHost}.sanity.studio` : null });
|
|
37
|
+
},
|
|
38
|
+
error: (error) => {
|
|
39
|
+
console.log('Error while looking for studioHost', error);
|
|
40
|
+
this.setState({
|
|
41
|
+
studioHost: {
|
|
42
|
+
error: 'Something went wrong while looking up studioHost. See console.',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
// ping assumed graphql endpoint
|
|
48
|
+
this.subscriptions.push(versionedClient.observable
|
|
49
|
+
.request({
|
|
50
|
+
method: 'HEAD',
|
|
51
|
+
uri: `/graphql/${dataset}/default`,
|
|
52
|
+
})
|
|
53
|
+
.subscribe({
|
|
54
|
+
next: () => this.setState({ graphqlApi: getGraphQlUrl() }),
|
|
55
|
+
error: (error) => {
|
|
56
|
+
if (error.statusCode === 404) {
|
|
57
|
+
this.setState({ graphqlApi: null });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.log('Error while looking for graphqlApi', error);
|
|
61
|
+
this.setState({
|
|
62
|
+
graphqlApi: {
|
|
63
|
+
error: 'Something went wrong while looking up graphqlApi. See console.',
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
componentWillUnmount() {
|
|
71
|
+
this.subscriptions.forEach((sub) => sub.unsubscribe());
|
|
72
|
+
}
|
|
73
|
+
assembleTableRows() {
|
|
74
|
+
const { graphqlApi, studioHost } = this.state;
|
|
75
|
+
const propsData = this.props.data;
|
|
76
|
+
let result = [
|
|
77
|
+
{
|
|
78
|
+
title: 'Sanity project',
|
|
79
|
+
rows: [
|
|
80
|
+
{ title: 'Project ID', value: projectId },
|
|
81
|
+
{ title: 'Dataset', value: dataset },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
// Handle any apps
|
|
86
|
+
const apps = [studioHost ? { title: 'Studio', value: studioHost } : null]
|
|
87
|
+
.concat(propsData.filter((item) => item.category === 'apps'))
|
|
88
|
+
.filter(Boolean);
|
|
89
|
+
if (apps.length > 0) {
|
|
90
|
+
result = result.concat([{ title: 'Apps', rows: apps }]);
|
|
91
|
+
}
|
|
92
|
+
// Handle APIs
|
|
93
|
+
result = result.concat([
|
|
94
|
+
{
|
|
95
|
+
title: 'APIs',
|
|
96
|
+
rows: [
|
|
97
|
+
{ title: 'GROQ', value: getGroqUrl() },
|
|
98
|
+
{ title: 'GraphQL', value: graphqlApi || 'Not deployed' },
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
], propsData.filter((item) => item.category === 'apis'));
|
|
102
|
+
// Handle whatever else there might be
|
|
103
|
+
const otherStuff = {};
|
|
104
|
+
propsData.forEach((item) => {
|
|
105
|
+
if (item.category !== 'apps' && item.category !== 'apis') {
|
|
106
|
+
if (!otherStuff[item.category]) {
|
|
107
|
+
otherStuff[item.category] = [];
|
|
108
|
+
}
|
|
109
|
+
otherStuff[item.category].push(item);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.keys(otherStuff).forEach((category) => {
|
|
113
|
+
result.push({ title: category, rows: otherStuff[category] });
|
|
114
|
+
});
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
return (React.createElement(React.Fragment, null,
|
|
119
|
+
this.props.__experimental_before &&
|
|
120
|
+
this.props.__experimental_before.map((widgetConfig, idx) => (React.createElement(WidgetContainer, { key: String(idx), config: widgetConfig }))),
|
|
121
|
+
React.createElement(Box, { height: "fill", marginTop: this.props.__experimental_before?.length > 0 ? 4 : 0 },
|
|
122
|
+
React.createElement(DashboardWidget, { footer: React.createElement(Button, { style: { width: '100%' }, paddingX: 2, paddingY: 4, mode: "bleed", tone: "primary", text: "Manage project", as: "a", href: getManageUrl() }) },
|
|
123
|
+
React.createElement(Card, { paddingY: 4, radius: 2, role: "table", "aria-label": "Project info", "aria-describedby": "project_info_table" },
|
|
124
|
+
React.createElement(Stack, { space: 4 },
|
|
125
|
+
React.createElement(Box, { paddingX: 3, as: "header" },
|
|
126
|
+
React.createElement(Heading, { size: 1, as: "h2", id: "project_info_table" }, "Project info")),
|
|
127
|
+
this.assembleTableRows().map((item) => {
|
|
128
|
+
if (!item || !item.rows) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return (React.createElement(Stack, { key: item.title, space: 3 },
|
|
132
|
+
React.createElement(Card, { borderBottom: true, padding: 3 },
|
|
133
|
+
React.createElement(Label, { size: 0, muted: true, role: "columnheader" }, item.title)),
|
|
134
|
+
React.createElement(Stack, { space: 4, paddingX: 3, role: "rowgroup" }, item.rows.map((row) => {
|
|
135
|
+
return (React.createElement(Grid, { key: row.title, columns: 2, role: "row" },
|
|
136
|
+
React.createElement(Text, { weight: "medium", role: "rowheader" }, row.title),
|
|
137
|
+
isPlainObject(row.value) && React.createElement(Text, { size: 1 }, row.value.error),
|
|
138
|
+
!isPlainObject(row.value) && (React.createElement(React.Fragment, null, isUrl(row.value) ? (React.createElement(Text, { size: 1, role: "cell", style: { wordBreak: 'break-word' } },
|
|
139
|
+
React.createElement("a", { href: row.value }, row.value))) : (React.createElement(Code, { size: 1, role: "cell", style: { wordBreak: 'break-word' } }, row.value))))));
|
|
140
|
+
}))));
|
|
141
|
+
})))))));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
ProjectInfo.propTypes = {
|
|
145
|
+
// eslint-disable-next-line camelcase
|
|
146
|
+
__experimental_before: PropTypes.array,
|
|
147
|
+
data: PropTypes.array,
|
|
148
|
+
};
|
|
149
|
+
ProjectInfo.defaultProps = {
|
|
150
|
+
// eslint-disable-next-line camelcase
|
|
151
|
+
__experimental_before: [],
|
|
152
|
+
data: [],
|
|
153
|
+
};
|
|
154
|
+
export default ProjectInfo;
|
|
155
|
+
//# sourceMappingURL=ProjectInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectInfo.js","sourceRoot":"","sources":["../../../../../src/widgets/projectInfo/ProjectInfo.js"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAA;AACpC,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,YAAY,CAAA;AACrF,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAA;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AAK,CAAC,CAAC,CAAC,CAAC,CAClB,oBAAC,IAAI,IAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,EAAC,SAAS,EAAE,YAAY,EAAC;gDACzD,2BAAG,IAAI,EAAE,GAAG,CAAC,KAAK,IAAG,GAAG,CAAC,KAAK,CAAK,CAC9B,CACR,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,IAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,EAAC,SAAS,EAAE,YAAY,EAAC,IACxD,GAAG,CAAC,KAAK,CACL,CACR,CACA,CACJ,CACI,CACR,CAAA;oCACH,CAAC,CAAC,CACI,CACF,CACT,CAAA;4BACH,CAAC,CAAC,CACI,CACH,CACS,CACd,CACL,CACJ,CAAA;IACH,CAAC;;AAxMM,qBAAS,GAAG;IACjB,qCAAqC;IACrC,qBAAqB,EAAE,SAAS,CAAC,KAAK;IACtC,IAAI,EAAE,SAAS,CAAC,KAAK;CACtB,CAAA;AACM,wBAAY,GAAG;IACpB,qCAAqC;IACrC,qBAAqB,EAAE,EAAE;IACzB,IAAI,EAAE,EAAE;CACT,CAAA;AAkMH,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export const name: string;
|
|
3
|
+
export { ProjectInfo as component };
|
|
4
|
+
export namespace layout {
|
|
5
|
+
const width: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default _default;
|
|
9
|
+
import ProjectInfo from "./ProjectInfo";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/projectInfo/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/widgets/projectInfo/index.js"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,eAAe;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAC;CAC1B,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default ProjectUsers;
|
|
2
|
+
declare class ProjectUsers extends React.PureComponent<any, any, any> {
|
|
3
|
+
static propTypes: {};
|
|
4
|
+
static defaultProps: {};
|
|
5
|
+
constructor(props: any);
|
|
6
|
+
constructor(props: any, context: any);
|
|
7
|
+
state: {
|
|
8
|
+
project: null;
|
|
9
|
+
users: null;
|
|
10
|
+
error: null;
|
|
11
|
+
};
|
|
12
|
+
componentDidMount(): void;
|
|
13
|
+
componentWillUnmount(): void;
|
|
14
|
+
fetchData(): void;
|
|
15
|
+
subscription: import("rxjs").Subscription | undefined;
|
|
16
|
+
handleRetryFetch: () => void;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
import React from "react";
|
|
20
|
+
//# sourceMappingURL=ProjectUsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUsers.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/projectUsers/ProjectUsers.js"],"names":[],"mappings":";AAyCA;IACE,qBAAqB;IACrB,wBAAwB;IAwIo2e,wBAA8C;IAAA,sCAAyJ;IAtInkf;;;;MAIC;IAED,0BAEC;IAED,6BAIC;IAED,kBA2BC;IArBC,sDAoBI;IAGN,6BAEC;IAED,sBAiFC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { map, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { Stack, Spinner, Card, Box, Text, Button } from '@sanity/ui';
|
|
4
|
+
import { RobotIcon } from '@sanity/icons';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { DefaultPreview } from '@sanity/base/components';
|
|
7
|
+
import { versionedClient } from '../../versionedClient';
|
|
8
|
+
import { DashboardWidget } from '../../DashboardTool';
|
|
9
|
+
import { userStore } from '../../legacyParts';
|
|
10
|
+
const AvatarWrapper = styled(Card) `
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
border-color: transparent;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
|
|
18
|
+
& > img {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: auto;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
function getInviteUrl(projectId) {
|
|
24
|
+
return `https://manage.sanity.io/projects/${projectId}/team/invite`;
|
|
25
|
+
}
|
|
26
|
+
function sortUsersByRobotStatus(userA, userB, project) {
|
|
27
|
+
const { members } = project;
|
|
28
|
+
const membershipA = members.find((member) => member.id === userA.id);
|
|
29
|
+
const membershipB = members.find((member) => member.id === userB.id);
|
|
30
|
+
if (membershipA.isRobot) {
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
if (membershipB.isRobot) {
|
|
34
|
+
return -1;
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
class ProjectUsers extends React.PureComponent {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.state = {
|
|
42
|
+
project: null,
|
|
43
|
+
users: null,
|
|
44
|
+
error: null,
|
|
45
|
+
};
|
|
46
|
+
this.handleRetryFetch = () => {
|
|
47
|
+
this.fetchData();
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
componentDidMount() {
|
|
51
|
+
this.fetchData();
|
|
52
|
+
}
|
|
53
|
+
componentWillUnmount() {
|
|
54
|
+
if (this.subscription) {
|
|
55
|
+
this.subscription.unsubscribe();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
fetchData() {
|
|
59
|
+
if (this.subscription) {
|
|
60
|
+
this.subscription.unsubscribe();
|
|
61
|
+
}
|
|
62
|
+
const { projectId } = versionedClient.config();
|
|
63
|
+
this.subscription = versionedClient.observable
|
|
64
|
+
.request({
|
|
65
|
+
uri: `/projects/${projectId}`,
|
|
66
|
+
})
|
|
67
|
+
.pipe(switchMap((project) => userStore.observable
|
|
68
|
+
.getUsers(project.members.map((mem) => mem.id))
|
|
69
|
+
.pipe(map((users) => ({ project, users })))))
|
|
70
|
+
.subscribe({
|
|
71
|
+
next: ({ users, project }) => this.setState({
|
|
72
|
+
project,
|
|
73
|
+
users: (Array.isArray(users) ? users : [users]).sort((userA, userB) => sortUsersByRobotStatus(userA, userB, project)),
|
|
74
|
+
}),
|
|
75
|
+
error: (error) => this.setState({ error }),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
const { error, project, users } = this.state;
|
|
80
|
+
const isLoading = !users || !project;
|
|
81
|
+
if (error) {
|
|
82
|
+
return (React.createElement(DashboardWidget, { header: "Project users" },
|
|
83
|
+
React.createElement(Box, { padding: 4 },
|
|
84
|
+
React.createElement(Text, null,
|
|
85
|
+
"Something went wrong while fetching data. You could",
|
|
86
|
+
' ',
|
|
87
|
+
React.createElement("a", { onClick: this.handleRetryFetch, title: "Retry users fetch", style: { cursor: 'pointer' } }, "retry"),
|
|
88
|
+
"..?"))));
|
|
89
|
+
}
|
|
90
|
+
return (React.createElement(DashboardWidget, { header: "Project users", footer: React.createElement(Button, { style: { width: '100%' }, paddingX: 2, paddingY: 4, mode: "bleed", tone: "primary", text: "Invite members", as: "a", loading: isLoading, href: isLoading ? undefined : getInviteUrl(project.id) }) },
|
|
91
|
+
isLoading && (React.createElement(Box, { paddingY: 5, paddingX: 2 },
|
|
92
|
+
React.createElement(Stack, { space: 4 },
|
|
93
|
+
React.createElement(Text, { align: "center", muted: true, size: 1 },
|
|
94
|
+
React.createElement(Spinner, null)),
|
|
95
|
+
React.createElement(Text, { align: "center", size: 1, muted: true }, "Loading items...")))),
|
|
96
|
+
!isLoading && (React.createElement(Stack, { space: 3, padding: 3 }, users.map((user) => {
|
|
97
|
+
const membership = project.members.find((member) => member.id === user.id);
|
|
98
|
+
const media = membership.isRobot ? (React.createElement(Text, { size: 3 },
|
|
99
|
+
React.createElement(RobotIcon, null))) : (React.createElement(AvatarWrapper, { tone: "transparent" }, user?.imageUrl && React.createElement("img", { src: user.imageUrl, alt: user?.displayName })));
|
|
100
|
+
return (React.createElement(Box, { key: user.id },
|
|
101
|
+
React.createElement(DefaultPreview, { title: user.displayName, subtitle: membership.role, media: media })));
|
|
102
|
+
})))));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
ProjectUsers.propTypes = {};
|
|
106
|
+
ProjectUsers.defaultProps = {};
|
|
107
|
+
export default ProjectUsers;
|
|
108
|
+
//# sourceMappingURL=ProjectUsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUsers.js","sourceRoot":"","sources":["../../../../../src/widgets/projectUsers/ProjectUsers.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,GAAG,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,YAAY,CAAA;AAClE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAA;AAE3C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;;;;;;CAYjC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,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CACjC,oBAAC,IAAI,IAAC,IAAI,EAAE,CAAC;oBACX,oBAAC,SAAS,OAAG,CACR,CACR,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IAAC,IAAI,EAAC,aAAa,IAC9B,IAAI,EAAE,QAAQ,IAAI,6BAAK,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAI,CACxD,CACjB,CAAA;gBACD,OAAO,CACL,oBAAC,GAAG,IAAC,GAAG,EAAE,IAAI,CAAC,EAAE;oBACf,oBAAC,cAAc,IACb,KAAK,EAAE,IAAI,CAAC,WAAW,EACvB,QAAQ,EAAE,UAAU,CAAC,IAAI,EACzB,KAAK,EAAE,KAAK,GACZ,CACE,CACP,CAAA;YACH,CAAC,CAAC,CACI,CACT,CACe,CACnB,CAAA;IACH,CAAC;;AArIM,sBAAS,GAAG,EAAE,CAAA;AACd,yBAAY,GAAG,EAAE,CAAA;AAuI1B,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/projectUsers/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/widgets/projectUsers/index.js"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,SAAS,EAAE,YAAY;CACxB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default SanityTutorials;
|
|
2
|
+
declare class SanityTutorials extends React.Component<any, any, any> {
|
|
3
|
+
static propTypes: {
|
|
4
|
+
templateRepoId: PropTypes.Requireable<string>;
|
|
5
|
+
};
|
|
6
|
+
static defaultProps: {
|
|
7
|
+
templateRepoId: null;
|
|
8
|
+
};
|
|
9
|
+
constructor(props: any);
|
|
10
|
+
constructor(props: any, context: any);
|
|
11
|
+
state: {
|
|
12
|
+
feedItems: never[];
|
|
13
|
+
};
|
|
14
|
+
componentDidMount(): void;
|
|
15
|
+
subscription: import("rxjs").Subscription | undefined;
|
|
16
|
+
componentWillUnmount(): void;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
import React from "react";
|
|
20
|
+
import PropTypes from "prop-types";
|
|
21
|
+
//# sourceMappingURL=SanityTutorials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SanityTutorials.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/SanityTutorials.js"],"names":[],"mappings":";AAmBA;IACE;;MAEC;IAED;;MAEC;IAiE2yiB,wBAA8C;IAAA,sCAAyJ;IA/Dn/iB;;MAEC;IAED,0BAOC;IALC,sDAIE;IAGJ,6BAIC;IAED,sBAwCC;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { get } from 'lodash';
|
|
4
|
+
import { Flex } from '@sanity/ui';
|
|
5
|
+
import { DashboardWidget } from '../../DashboardTool';
|
|
6
|
+
import Tutorial from './Tutorial';
|
|
7
|
+
import dataAdapter from './dataAdapter';
|
|
8
|
+
const { urlBuilder, getFeed } = dataAdapter;
|
|
9
|
+
function createUrl(slug, type) {
|
|
10
|
+
if (type === 'tutorial') {
|
|
11
|
+
return `https://www.sanity.io/docs/tutorials/${slug.current}`;
|
|
12
|
+
}
|
|
13
|
+
else if (type === 'guide') {
|
|
14
|
+
return `https://www.sanity.io/docs/guides/${slug.current}`;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
class SanityTutorials extends React.Component {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.state = {
|
|
22
|
+
feedItems: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
componentDidMount() {
|
|
26
|
+
const { templateRepoId } = this.props;
|
|
27
|
+
this.subscription = getFeed(templateRepoId).subscribe((response) => {
|
|
28
|
+
this.setState({
|
|
29
|
+
feedItems: response.items,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
componentWillUnmount() {
|
|
34
|
+
if (this.subscription) {
|
|
35
|
+
this.subscription.unsubscribe();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const { feedItems } = this.state;
|
|
40
|
+
const title = 'Learn about Sanity';
|
|
41
|
+
return (React.createElement(DashboardWidget, { header: title },
|
|
42
|
+
React.createElement(Flex, { as: "ul", overflow: "auto", align: "stretch", paddingY: 2 }, feedItems?.map((feedItem, index) => {
|
|
43
|
+
if (!feedItem.title || (!feedItem.guideOrTutorial && !feedItem.externalLink)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const presenter = feedItem.presenter || get(feedItem, 'guideOrTutorial.presenter') || {};
|
|
47
|
+
const subtitle = get(feedItem, 'category');
|
|
48
|
+
const { guideOrTutorial = {} } = feedItem;
|
|
49
|
+
return (React.createElement(Flex, { as: "li", key: feedItem._id, paddingRight: index < feedItems?.length - 1 ? 1 : 3, paddingLeft: index === 0 ? 3 : 0, align: "stretch", flex: "0 0 27.5%", style: { minWidth: 272, width: '30%' } },
|
|
50
|
+
React.createElement(Tutorial, { title: feedItem.title, href: createUrl(guideOrTutorial.slug, guideOrTutorial._type) || feedItem.externalLink, presenterName: presenter.name, presenterSubtitle: subtitle, showPlayIcon: feedItem.hasVideo, posterURL: urlBuilder.image(feedItem.poster).height(360).url() })));
|
|
51
|
+
}))));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
SanityTutorials.propTypes = {
|
|
55
|
+
templateRepoId: PropTypes.string,
|
|
56
|
+
};
|
|
57
|
+
SanityTutorials.defaultProps = {
|
|
58
|
+
templateRepoId: null,
|
|
59
|
+
};
|
|
60
|
+
export default SanityTutorials;
|
|
61
|
+
//# sourceMappingURL=SanityTutorials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SanityTutorials.js","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/SanityTutorials.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAA;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAA;AACnD,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAC,GAAG,WAAW,CAAA;AAEzC,SAAS,SAAS,CAAC,IAAI,EAAE,IAAI;IAC3B,IAAI,IAAI,KAAK,UAAU,EAAE;QACvB,OAAO,wCAAwC,IAAI,CAAC,OAAO,EAAE,CAAA;KAC9D;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE;QAC3B,OAAO,qCAAqC,IAAI,CAAC,OAAO,EAAE,CAAA;KAC3D;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,eAAgB,SAAQ,KAAK,CAAC,SAAS;IAA7C;;QASE,UAAK,GAAG;YACN,SAAS,EAAE,EAAE;SACd,CAAA;IA0DH,CAAC;IAxDC,iBAAiB;QACf,MAAM,EAAC,cAAc,EAAC,GAAG,IAAI,CAAC,KAAK,CAAA;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjE,IAAI,CAAC,QAAQ,CAAC;gBACZ,SAAS,EAAE,QAAQ,CAAC,KAAK;aAC1B,CAAC,CAAA;QACJ,CAAC,CAAC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QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAC;oBAEpC,oBAAC,QAAQ,IACP,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,IAAI,EACF,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,YAAY,EAEjF,aAAa,EAAE,SAAS,CAAC,IAAI,EAC7B,iBAAiB,EAAE,QAAQ,EAC3B,YAAY,EAAE,QAAQ,CAAC,QAAQ,EAC/B,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAC9D,CACG,CACR,CAAA;YACH,CAAC,CAAC,CACG,CACS,CACnB,CAAA;IACH,CAAC;;AAnEM,yBAAS,GAAG;IACjB,cAAc,EAAE,SAAS,CAAC,MAAM;CACjC,CAAA;AAEM,4BAAY,GAAG;IACpB,cAAc,EAAE,IAAI;CACrB,CAAA;AAgEH,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Tutorial;
|
|
2
|
+
declare class Tutorial extends React.PureComponent<any, any, any> {
|
|
3
|
+
static propTypes: {
|
|
4
|
+
title: PropTypes.Validator<string>;
|
|
5
|
+
posterURL: PropTypes.Requireable<string>;
|
|
6
|
+
href: PropTypes.Validator<string>;
|
|
7
|
+
showPlayIcon: PropTypes.Requireable<boolean>;
|
|
8
|
+
presenterName: PropTypes.Validator<string>;
|
|
9
|
+
presenterSubtitle: PropTypes.Validator<string>;
|
|
10
|
+
};
|
|
11
|
+
static defaultProps: {
|
|
12
|
+
posterURL: null;
|
|
13
|
+
showPlayIcon: boolean;
|
|
14
|
+
};
|
|
15
|
+
constructor(props: any);
|
|
16
|
+
constructor(props: any, context: any);
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
import React from "react";
|
|
20
|
+
import PropTypes from "prop-types";
|
|
21
|
+
//# sourceMappingURL=Tutorial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/Tutorial.js"],"names":[],"mappings":";AAwDA;IACE;;;;;;;MAOC;IACD;;;MAGC;IAoD8jiB,wBAA8C;IAAA,sCAAyJ;IAlDtwiB,sBA8CC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Card, Box, Heading, Flex, Text, Stack } from '@sanity/ui';
|
|
4
|
+
import { PlayIcon } from '@sanity/icons';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
const PlayIconBox = styled(Box) `
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 50%;
|
|
9
|
+
left: 50%;
|
|
10
|
+
transform: translate(-50%, -50%);
|
|
11
|
+
|
|
12
|
+
&:before {
|
|
13
|
+
content: '';
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 50%;
|
|
16
|
+
left: 50%;
|
|
17
|
+
transform: translate(-50%, -50%);
|
|
18
|
+
width: 2.75em;
|
|
19
|
+
height: 2.75em;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
background: ${({ theme }) => theme.sanity.color.card.enabled.bg};
|
|
22
|
+
opacity: 0.75;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const Root = styled(Flex) `
|
|
26
|
+
&:hover {
|
|
27
|
+
${PlayIconBox} {
|
|
28
|
+
&:before {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
const PosterCard = styled(Card) `
|
|
35
|
+
width: 100%;
|
|
36
|
+
padding-bottom: calc(9 / 16 * 100%);
|
|
37
|
+
position: relative;
|
|
38
|
+
`;
|
|
39
|
+
const Poster = styled.img `
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
object-fit: cover;
|
|
46
|
+
display: block;
|
|
47
|
+
|
|
48
|
+
&:not([src]) {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
class Tutorial extends React.PureComponent {
|
|
53
|
+
render() {
|
|
54
|
+
const { title, posterURL, showPlayIcon, href, presenterName, presenterSubtitle } = this.props;
|
|
55
|
+
return (React.createElement(Root, { flex: 1 },
|
|
56
|
+
React.createElement(Card, { sizing: "border", flex: 1, padding: 2, radius: 2, as: "a", href: href, target: "_blank", rel: "noopener noreferrer", style: { position: 'relative' } },
|
|
57
|
+
React.createElement(Flex, { direction: "column", style: { height: '100%' } },
|
|
58
|
+
posterURL && (React.createElement(PosterCard, { marginBottom: 1 },
|
|
59
|
+
React.createElement(Poster, { src: posterURL }),
|
|
60
|
+
showPlayIcon && (React.createElement(PlayIconBox, { display: "flex" },
|
|
61
|
+
React.createElement(Text, { align: "center" },
|
|
62
|
+
React.createElement(PlayIcon, null)))))),
|
|
63
|
+
React.createElement(Flex, { direction: "column", justify: "space-between", paddingY: 2, flex: 1 },
|
|
64
|
+
React.createElement(Heading, { as: "h3", size: 1 }, title),
|
|
65
|
+
React.createElement(Box, { marginTop: 4 },
|
|
66
|
+
React.createElement(Stack, { space: 2, flex: 1 },
|
|
67
|
+
React.createElement(Text, { size: 1 }, presenterName),
|
|
68
|
+
React.createElement(Text, { size: 0, style: { opacity: 0.7 } }, presenterSubtitle))))))));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
Tutorial.propTypes = {
|
|
72
|
+
title: PropTypes.string.isRequired,
|
|
73
|
+
posterURL: PropTypes.string,
|
|
74
|
+
href: PropTypes.string.isRequired,
|
|
75
|
+
showPlayIcon: PropTypes.bool,
|
|
76
|
+
presenterName: PropTypes.string.isRequired,
|
|
77
|
+
presenterSubtitle: PropTypes.string.isRequired,
|
|
78
|
+
};
|
|
79
|
+
Tutorial.defaultProps = {
|
|
80
|
+
posterURL: null,
|
|
81
|
+
showPlayIcon: false,
|
|
82
|
+
};
|
|
83
|
+
export default Tutorial;
|
|
84
|
+
//# sourceMappingURL=Tutorial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/Tutorial.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,YAAY,CAAA;AAChE,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AACtC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;;;;;;;;;kBAeb,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;;;CAGhE,CAAA;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;MAEnB,WAAW;;;;;;CAMhB,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;CAI9B,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAYxB,CAAA;AAED,MAAM,QAAS,SAAQ,KAAK,CAAC,aAAa;IAcxC,MAAM;QACJ,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAC,GAAG,IAAI,CAAC,KAAK,CAAA;QAE3F,OAAO,CACL,oBAAC,IAAI,IAAC,IAAI,EAAE,CAAC;Y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;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACjC,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAC1C,iBAAiB,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CAC/C,CAAA;AACM,qBAAY,GAAG;IACpB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,KAAK;CACpB,CAAA;AAmDH,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/dataAdapter.js"],"names":[],"mappings":";IASW,sEAKR"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import imageUrlBuilder from '@sanity/image-url';
|
|
2
|
+
import { versionedClient } from '../../versionedClient';
|
|
3
|
+
const tutorialsProjectConfig = {
|
|
4
|
+
projectId: '3do82whm',
|
|
5
|
+
dataset: 'next',
|
|
6
|
+
};
|
|
7
|
+
export default {
|
|
8
|
+
getFeed: (templateRepoId) => {
|
|
9
|
+
const uri = templateRepoId
|
|
10
|
+
? `/addons/dashboard?templateRepoId=${templateRepoId}`
|
|
11
|
+
: '/addons/dashboard';
|
|
12
|
+
return versionedClient.observable.request({ uri, withCredentials: false });
|
|
13
|
+
},
|
|
14
|
+
urlBuilder: imageUrlBuilder(tutorialsProjectConfig),
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=dataAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataAdapter.js","sourceRoot":"","sources":["../../../../../src/widgets/sanityTutorials/dataAdapter.js"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAA;AAErD,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,UAAU;IACrB,OAAO,EAAE,MAAM;CAChB,CAAA;AAED,eAAe;IACb,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAG,cAAc;YACxB,CAAC,CAAC,oCAAoC,cAAc,EAAE;YACtD,CAAC,CAAC,mBAAmB,CAAA;QACvB,OAAO,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,EAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAC,CAAC,CAAA;IAC1E,CAAC;IACD,UAAU,EAAE,eAAe,CAAC,sBAAsB,CAAC;CACpD,CAAA"}
|