@sanity/dashboard 3.0.0-studio-v3.0 → 3.0.0-v3-studio.0
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/lib/cjs/index.js +198 -196
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +193 -191
- package/lib/esm/index.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +18 -10
- package/sanity.json +8 -0
- package/src/widgets/projectUsers/ProjectUsers.tsx +7 -8
- package/v2-incompatible.js +11 -0
package/lib/esm/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {jsxs as $
|
|
2
|
-
import {useMemo as $
|
|
3
|
-
import {createPlugin as $
|
|
4
|
-
import {Container as $
|
|
5
|
-
import $
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import $
|
|
1
|
+
import {jsxs as $7XdDa$jsxs, jsx as $7XdDa$jsx, Fragment as $7XdDa$Fragment} from "react/jsx-runtime";
|
|
2
|
+
import {useMemo as $7XdDa$useMemo, createElement as $7XdDa$createElement, createContext as $7XdDa$createContext, useContext as $7XdDa$useContext, forwardRef as $7XdDa$forwardRef, useState as $7XdDa$useState, useEffect as $7XdDa$useEffect, useCallback as $7XdDa$useCallback} from "react";
|
|
3
|
+
import {createPlugin as $7XdDa$createPlugin, useClient as $7XdDa$useClient} from "sanity";
|
|
4
|
+
import {Container as $7XdDa$Container, Grid as $7XdDa$Grid, Card as $7XdDa$Card, Text as $7XdDa$Text, Box as $7XdDa$Box, Heading as $7XdDa$Heading, Button as $7XdDa$Button, Stack as $7XdDa$Stack, Label as $7XdDa$Label, Code as $7XdDa$Code, Spinner as $7XdDa$Spinner, Flex as $7XdDa$Flex} from "@sanity/ui";
|
|
5
|
+
import $7XdDa$styledcomponents, {css as $7XdDa$css} from "styled-components";
|
|
6
|
+
import {from as $7XdDa$from} from "rxjs";
|
|
7
|
+
import {switchMap as $7XdDa$switchMap, map as $7XdDa$map} from "rxjs/operators";
|
|
8
|
+
import {RobotIcon as $7XdDa$RobotIcon, PlayIcon as $7XdDa$PlayIcon} from "@sanity/icons";
|
|
9
|
+
import {useUserStore as $7XdDa$useUserStore, DefaultPreview as $7XdDa$DefaultPreview} from "sanity/_unstable";
|
|
10
|
+
import $7XdDa$sanityimageurl from "@sanity/image-url";
|
|
10
11
|
|
|
11
12
|
function $parcel$export(e, n, v, s) {
|
|
12
13
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -18,8 +19,8 @@ function $parcel$export(e, n, v, s) {
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
function $
|
|
22
|
-
return /*#__PURE__*/ (0, $
|
|
22
|
+
function $82da5a035d695e7d$export$3469e8c87b54056a(props) {
|
|
23
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Container), {
|
|
23
24
|
width: 4,
|
|
24
25
|
padding: 4,
|
|
25
26
|
sizing: "border",
|
|
@@ -38,46 +39,46 @@ function $bb6535128092451c$export$3469e8c87b54056a(props) {
|
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
const $
|
|
42
|
+
const $eb4b9ad66697c2d1$export$3d9a716c82234f3d = /*#__PURE__*/ (0, $7XdDa$createContext)({
|
|
42
43
|
widgets: []
|
|
43
44
|
});
|
|
44
|
-
function $
|
|
45
|
-
return (0, $
|
|
45
|
+
function $eb4b9ad66697c2d1$export$f69a0df1904034e() {
|
|
46
|
+
return (0, $7XdDa$useContext)($eb4b9ad66697c2d1$export$3d9a716c82234f3d);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
|
|
50
|
-
function $
|
|
51
|
-
const config = (0, $
|
|
52
|
-
const layout = (0, $
|
|
51
|
+
function $d8fd3c76581cae12$export$d320a48219c7c153(props) {
|
|
52
|
+
const config = (0, $eb4b9ad66697c2d1$export$f69a0df1904034e)();
|
|
53
|
+
const layout = (0, $7XdDa$useMemo)(()=>({
|
|
53
54
|
...props.layout || {},
|
|
54
55
|
...config.layout || {}
|
|
55
56
|
}), [
|
|
56
57
|
props.layout,
|
|
57
58
|
config.layout
|
|
58
59
|
]);
|
|
59
|
-
return /*#__PURE__*/ (0, $
|
|
60
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Card), {
|
|
60
61
|
shadow: 1,
|
|
61
62
|
"data-width": layout.width,
|
|
62
63
|
"data-height": layout.height,
|
|
63
|
-
children: /*#__PURE__*/ (0, $
|
|
64
|
+
children: /*#__PURE__*/ (0, $7XdDa$createElement)(props.component, {})
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
|
|
68
|
-
const $
|
|
69
|
-
small: (...args)=>(0, $
|
|
69
|
+
const $b3f6c4935414fea5$var$media = {
|
|
70
|
+
small: (...args)=>(0, $7XdDa$css)`
|
|
70
71
|
@media (min-width: ${({ theme: theme })=>theme.sanity.media[0]}px) {
|
|
71
|
-
${(0, $
|
|
72
|
+
${(0, $7XdDa$css)(...args)}
|
|
72
73
|
}
|
|
73
74
|
`,
|
|
74
|
-
medium: (...args)=>(0, $
|
|
75
|
+
medium: (...args)=>(0, $7XdDa$css)`
|
|
75
76
|
@media (min-width: ${({ theme: theme })=>theme.sanity.media[2]}px) {
|
|
76
|
-
${(0, $
|
|
77
|
+
${(0, $7XdDa$css)(...args)}
|
|
77
78
|
}
|
|
78
79
|
`
|
|
79
80
|
};
|
|
80
|
-
const $
|
|
81
|
+
const $b3f6c4935414fea5$var$Root = (0, $7XdDa$styledcomponents)((0, $7XdDa$Grid))`
|
|
81
82
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
82
83
|
|
|
83
84
|
& > div {
|
|
@@ -85,76 +86,76 @@ const $a64f5fea4a0ce905$var$Root = (0, $5lYf0$styledcomponents)((0, $5lYf0$Grid)
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
& > div[data-width='medium'] {
|
|
88
|
-
${$
|
|
89
|
+
${$b3f6c4935414fea5$var$media.small`
|
|
89
90
|
grid-column: span 2;
|
|
90
91
|
`}
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
& > div[data-width='large'] {
|
|
94
|
-
${$
|
|
95
|
+
${$b3f6c4935414fea5$var$media.small`
|
|
95
96
|
grid-column: span 2;
|
|
96
97
|
`}
|
|
97
98
|
|
|
98
|
-
${$
|
|
99
|
+
${$b3f6c4935414fea5$var$media.medium`
|
|
99
100
|
grid-column: span 3;
|
|
100
101
|
`}
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
& > div[data-width='full'] {
|
|
104
|
-
${$
|
|
105
|
+
${$b3f6c4935414fea5$var$media.small`
|
|
105
106
|
grid-column: 1 / -1;
|
|
106
107
|
`}
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
& > div[data-height='medium'] {
|
|
110
|
-
${$
|
|
111
|
+
${$b3f6c4935414fea5$var$media.small`
|
|
111
112
|
grid-row: span 2;
|
|
112
113
|
`}
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
& > div[data-height='large'] {
|
|
116
|
-
${$
|
|
117
|
+
${$b3f6c4935414fea5$var$media.small`
|
|
117
118
|
grid-row: span 2;
|
|
118
119
|
`}
|
|
119
120
|
|
|
120
|
-
${$
|
|
121
|
+
${$b3f6c4935414fea5$var$media.medium`
|
|
121
122
|
grid-row: span 3;
|
|
122
123
|
`}
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
& > div[data-height='full'] {
|
|
126
|
-
${$
|
|
127
|
+
${$b3f6c4935414fea5$var$media.medium`
|
|
127
128
|
grid-row: 1 / -1;
|
|
128
129
|
`}
|
|
129
130
|
}
|
|
130
131
|
`;
|
|
131
|
-
const $
|
|
132
|
-
const $
|
|
133
|
-
function $
|
|
134
|
-
const { config: { layout: layout = $
|
|
135
|
-
return /*#__PURE__*/ (0, $
|
|
132
|
+
const $b3f6c4935414fea5$var$NO_WIDGETS = [];
|
|
133
|
+
const $b3f6c4935414fea5$var$NO_LAYOUT = {};
|
|
134
|
+
function $b3f6c4935414fea5$export$606a10b16bce9144(props) {
|
|
135
|
+
const { config: { layout: layout = $b3f6c4935414fea5$var$NO_LAYOUT , widgets: widgets = $b3f6c4935414fea5$var$NO_WIDGETS } , } = props;
|
|
136
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)($b3f6c4935414fea5$var$Root, {
|
|
136
137
|
autoFlow: "row dense",
|
|
137
138
|
"data-width": layout.width || "auto",
|
|
138
139
|
"data-height": layout.height || "auto",
|
|
139
140
|
gap: 4,
|
|
140
141
|
children: [
|
|
141
|
-
widgets.length ? null : /*#__PURE__*/ (0, $
|
|
142
|
+
widgets.length ? null : /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Card), {
|
|
142
143
|
padding: 4,
|
|
143
144
|
shadow: 1,
|
|
144
145
|
tone: "primary",
|
|
145
|
-
children: /*#__PURE__*/ (0, $
|
|
146
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
146
147
|
align: "center",
|
|
147
148
|
children: "Add some widgets to populate this space."
|
|
148
149
|
})
|
|
149
150
|
}),
|
|
150
151
|
widgets.map((widgetConfig, index)=>{
|
|
151
|
-
if (widgetConfig.type === "__experimental_group") return /*#__PURE__*/ (0, $
|
|
152
|
+
if (widgetConfig.type === "__experimental_group") return /*#__PURE__*/ (0, $7XdDa$jsx)($b3f6c4935414fea5$export$606a10b16bce9144, {
|
|
152
153
|
config: widgetConfig
|
|
153
154
|
}, index);
|
|
154
|
-
if (widgetConfig.component) return /*#__PURE__*/ (0, $
|
|
155
|
+
if (widgetConfig.component) return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $d8fd3c76581cae12$export$d320a48219c7c153), {
|
|
155
156
|
...widgetConfig
|
|
156
157
|
}, index);
|
|
157
|
-
return /*#__PURE__*/ (0, $
|
|
158
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Box), {
|
|
158
159
|
children: [
|
|
159
160
|
widgetConfig.name,
|
|
160
161
|
" is missing widget component"
|
|
@@ -167,12 +168,12 @@ function $a64f5fea4a0ce905$export$606a10b16bce9144(props) {
|
|
|
167
168
|
|
|
168
169
|
|
|
169
170
|
|
|
170
|
-
function $
|
|
171
|
+
function $415e81216941c75c$export$fe82a520fc33e5f4({ config: config }) {
|
|
171
172
|
if (!config) return null;
|
|
172
|
-
return /*#__PURE__*/ (0, $
|
|
173
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $eb4b9ad66697c2d1$export$3d9a716c82234f3d).Provider, {
|
|
173
174
|
value: config,
|
|
174
|
-
children: /*#__PURE__*/ (0, $
|
|
175
|
-
children: /*#__PURE__*/ (0, $
|
|
175
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $82da5a035d695e7d$export$3469e8c87b54056a), {
|
|
176
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $b3f6c4935414fea5$export$606a10b16bce9144), {
|
|
176
177
|
config: config
|
|
177
178
|
})
|
|
178
179
|
})
|
|
@@ -181,17 +182,17 @@ function $086586914f992408$export$fe82a520fc33e5f4({ config: config }) {
|
|
|
181
182
|
|
|
182
183
|
|
|
183
184
|
|
|
184
|
-
var $
|
|
185
|
+
var $f17097ca2e05ac05$exports = {};
|
|
185
186
|
|
|
186
187
|
|
|
187
|
-
var $
|
|
188
|
+
var $17a16bf8b6a46960$exports = {};
|
|
188
189
|
|
|
189
|
-
$parcel$export($
|
|
190
|
+
$parcel$export($17a16bf8b6a46960$exports, "DashboardWidgetContainer", () => $17a16bf8b6a46960$export$67b2e85605d868b2);
|
|
190
191
|
|
|
191
192
|
|
|
192
193
|
|
|
193
194
|
|
|
194
|
-
const $
|
|
195
|
+
const $17a16bf8b6a46960$var$Root = (0, $7XdDa$styledcomponents)((0, $7XdDa$Card))`
|
|
195
196
|
display: flex;
|
|
196
197
|
flex-direction: column;
|
|
197
198
|
justify-content: stretch;
|
|
@@ -199,14 +200,14 @@ const $1f0cda7387acedc8$var$Root = (0, $5lYf0$styledcomponents)((0, $5lYf0$Card)
|
|
|
199
200
|
box-sizing: border-box;
|
|
200
201
|
position: relative;
|
|
201
202
|
`;
|
|
202
|
-
const $
|
|
203
|
+
const $17a16bf8b6a46960$var$Header = (0, $7XdDa$styledcomponents)((0, $7XdDa$Card))`
|
|
203
204
|
position: sticky;
|
|
204
205
|
top: 0;
|
|
205
206
|
z-index: 2;
|
|
206
207
|
border-top-left-radius: inherit;
|
|
207
208
|
border-top-right-radius: inherit;
|
|
208
209
|
`;
|
|
209
|
-
const $
|
|
210
|
+
const $17a16bf8b6a46960$var$Footer = (0, $7XdDa$styledcomponents)((0, $7XdDa$Card))`
|
|
210
211
|
position: sticky;
|
|
211
212
|
overflow: hidden;
|
|
212
213
|
bottom: 0;
|
|
@@ -215,7 +216,7 @@ const $1f0cda7387acedc8$var$Footer = (0, $5lYf0$styledcomponents)((0, $5lYf0$Car
|
|
|
215
216
|
border-bottom-left-radius: inherit;
|
|
216
217
|
margin-top: auto;
|
|
217
218
|
`;
|
|
218
|
-
const $
|
|
219
|
+
const $17a16bf8b6a46960$var$Content = (0, $7XdDa$styledcomponents)((0, $7XdDa$Box))`
|
|
219
220
|
position: relative;
|
|
220
221
|
z-index: 1;
|
|
221
222
|
height: stretch;
|
|
@@ -226,27 +227,27 @@ const $1f0cda7387acedc8$var$Content = (0, $5lYf0$styledcomponents)((0, $5lYf0$Bo
|
|
|
226
227
|
outline: none;
|
|
227
228
|
}
|
|
228
229
|
`;
|
|
229
|
-
const $
|
|
230
|
+
const $17a16bf8b6a46960$export$67b2e85605d868b2 = /*#__PURE__*/ (0, $7XdDa$forwardRef)(function DashboardWidgetContainer(props, ref) {
|
|
230
231
|
const { header: header , children: children , footer: footer } = props;
|
|
231
|
-
return /*#__PURE__*/ (0, $
|
|
232
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)($17a16bf8b6a46960$var$Root, {
|
|
232
233
|
radius: 3,
|
|
233
234
|
display: "flex",
|
|
234
235
|
ref: ref,
|
|
235
236
|
children: [
|
|
236
|
-
header && /*#__PURE__*/ (0, $
|
|
237
|
+
header && /*#__PURE__*/ (0, $7XdDa$jsx)($17a16bf8b6a46960$var$Header, {
|
|
237
238
|
borderBottom: true,
|
|
238
239
|
paddingX: 3,
|
|
239
240
|
paddingY: 4,
|
|
240
|
-
children: /*#__PURE__*/ (0, $
|
|
241
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Heading), {
|
|
241
242
|
size: 1,
|
|
242
243
|
textOverflow: "ellipsis",
|
|
243
244
|
children: header
|
|
244
245
|
})
|
|
245
246
|
}),
|
|
246
|
-
children && /*#__PURE__*/ (0, $
|
|
247
|
+
children && /*#__PURE__*/ (0, $7XdDa$jsx)($17a16bf8b6a46960$var$Content, {
|
|
247
248
|
children: children
|
|
248
249
|
}),
|
|
249
|
-
footer && /*#__PURE__*/ (0, $
|
|
250
|
+
footer && /*#__PURE__*/ (0, $7XdDa$jsx)($17a16bf8b6a46960$var$Footer, {
|
|
250
251
|
borderTop: true,
|
|
251
252
|
children: footer
|
|
252
253
|
})
|
|
@@ -255,17 +256,17 @@ const $1f0cda7387acedc8$export$67b2e85605d868b2 = /*#__PURE__*/ (0, $5lYf0$forwa
|
|
|
255
256
|
});
|
|
256
257
|
|
|
257
258
|
|
|
258
|
-
var $
|
|
259
|
+
var $78de0fa9a220e58e$exports = {};
|
|
259
260
|
|
|
260
|
-
$parcel$export($
|
|
261
|
+
$parcel$export($78de0fa9a220e58e$exports, "projectInfoWidget", () => $78de0fa9a220e58e$export$66362ea0e7ee12e);
|
|
261
262
|
|
|
262
263
|
|
|
263
264
|
|
|
264
265
|
|
|
265
266
|
|
|
266
|
-
function $
|
|
267
|
-
const client = (0, $
|
|
268
|
-
return (0, $
|
|
267
|
+
function $63829e89ad9918b0$export$270fde7c7e72cf26() {
|
|
268
|
+
const client = (0, $7XdDa$useClient)();
|
|
269
|
+
return (0, $7XdDa$useMemo)(()=>client.withConfig({
|
|
269
270
|
apiVersion: "1"
|
|
270
271
|
}), [
|
|
271
272
|
client
|
|
@@ -275,27 +276,27 @@ function $3a278251aab3d81f$export$270fde7c7e72cf26() {
|
|
|
275
276
|
|
|
276
277
|
|
|
277
278
|
|
|
278
|
-
function $
|
|
279
|
+
function $979771a49dfb41e9$var$isUrl(url) {
|
|
279
280
|
return url && /^https?:\/\//.test(`${url}`);
|
|
280
281
|
}
|
|
281
|
-
function $
|
|
282
|
+
function $979771a49dfb41e9$var$getGraphQlUrl(projectId, dataset) {
|
|
282
283
|
return `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
|
|
283
284
|
}
|
|
284
|
-
function $
|
|
285
|
+
function $979771a49dfb41e9$var$getGroqUrl(projectId, dataset) {
|
|
285
286
|
return `https://${projectId}.api.sanity.io/v1/groq/${dataset}`;
|
|
286
287
|
}
|
|
287
|
-
function $
|
|
288
|
+
function $979771a49dfb41e9$var$getManageUrl(projectId) {
|
|
288
289
|
return `https://manage.sanity.io/projects/${projectId}`;
|
|
289
290
|
}
|
|
290
|
-
const $
|
|
291
|
-
const $
|
|
292
|
-
function $
|
|
293
|
-
const { __experimental_before: __experimental_before = $
|
|
294
|
-
const [studioHost, setStudioHost] = (0, $
|
|
295
|
-
const [graphqlApi, setGraphQlApi] = (0, $
|
|
296
|
-
const versionedClient = (0, $
|
|
291
|
+
const $979771a49dfb41e9$var$NO_EXPERIMENTAL = [];
|
|
292
|
+
const $979771a49dfb41e9$var$NO_DATA = [];
|
|
293
|
+
function $979771a49dfb41e9$export$a1c9a67310a2d004(props) {
|
|
294
|
+
const { __experimental_before: __experimental_before = $979771a49dfb41e9$var$NO_EXPERIMENTAL , data: data = $979771a49dfb41e9$var$NO_DATA } = props;
|
|
295
|
+
const [studioHost, setStudioHost] = (0, $7XdDa$useState)();
|
|
296
|
+
const [graphqlApi, setGraphQlApi] = (0, $7XdDa$useState)();
|
|
297
|
+
const versionedClient = (0, $63829e89ad9918b0$export$270fde7c7e72cf26)();
|
|
297
298
|
const { projectId: projectId = "unknown" , dataset: dataset = "unknown" } = versionedClient.config();
|
|
298
|
-
(0, $
|
|
299
|
+
(0, $7XdDa$useEffect)(()=>{
|
|
299
300
|
const subscriptions = [];
|
|
300
301
|
subscriptions.push(versionedClient.observable.request({
|
|
301
302
|
uri: `/projects/${projectId}`
|
|
@@ -316,7 +317,7 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
316
317
|
method: "HEAD",
|
|
317
318
|
uri: `/graphql/${dataset}/default`
|
|
318
319
|
}).subscribe({
|
|
319
|
-
next: ()=>setGraphQlApi($
|
|
320
|
+
next: ()=>setGraphQlApi($979771a49dfb41e9$var$getGraphQlUrl(projectId, dataset)),
|
|
320
321
|
error: (error)=>{
|
|
321
322
|
if (error.statusCode === 404) setGraphQlApi(undefined);
|
|
322
323
|
else {
|
|
@@ -337,7 +338,7 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
337
338
|
setGraphQlApi,
|
|
338
339
|
setStudioHost
|
|
339
340
|
]);
|
|
340
|
-
const assembleTableRows = (0, $
|
|
341
|
+
const assembleTableRows = (0, $7XdDa$useMemo)(()=>{
|
|
341
342
|
let result = [
|
|
342
343
|
{
|
|
343
344
|
title: "Sanity project",
|
|
@@ -374,7 +375,7 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
374
375
|
rows: [
|
|
375
376
|
{
|
|
376
377
|
title: "GROQ",
|
|
377
|
-
value: $
|
|
378
|
+
value: $979771a49dfb41e9$var$getGroqUrl(projectId, dataset)
|
|
378
379
|
},
|
|
379
380
|
{
|
|
380
381
|
title: "GraphQL",
|
|
@@ -405,16 +406,16 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
405
406
|
dataset,
|
|
406
407
|
data
|
|
407
408
|
]);
|
|
408
|
-
return /*#__PURE__*/ (0, $
|
|
409
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Fragment), {
|
|
409
410
|
children: [
|
|
410
|
-
__experimental_before.map((widgetConfig, idx)=>/*#__PURE__*/ (0, $
|
|
411
|
+
__experimental_before.map((widgetConfig, idx)=>/*#__PURE__*/ (0, $7XdDa$jsx)((0, $d8fd3c76581cae12$export$d320a48219c7c153), {
|
|
411
412
|
...widgetConfig
|
|
412
413
|
}, idx)),
|
|
413
|
-
/*#__PURE__*/ (0, $
|
|
414
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
414
415
|
height: "fill",
|
|
415
416
|
marginTop: __experimental_before?.length > 0 ? 4 : 0,
|
|
416
|
-
children: /*#__PURE__*/ (0, $
|
|
417
|
-
footer: /*#__PURE__*/ (0, $
|
|
417
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $17a16bf8b6a46960$export$67b2e85605d868b2), {
|
|
418
|
+
footer: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Button), {
|
|
418
419
|
style: {
|
|
419
420
|
width: "100%"
|
|
420
421
|
},
|
|
@@ -424,21 +425,21 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
424
425
|
tone: "primary",
|
|
425
426
|
text: "Manage project",
|
|
426
427
|
as: "a",
|
|
427
|
-
href: $
|
|
428
|
+
href: $979771a49dfb41e9$var$getManageUrl(projectId)
|
|
428
429
|
}),
|
|
429
|
-
children: /*#__PURE__*/ (0, $
|
|
430
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Card), {
|
|
430
431
|
paddingY: 4,
|
|
431
432
|
radius: 2,
|
|
432
433
|
role: "table",
|
|
433
434
|
"aria-label": "Project info",
|
|
434
435
|
"aria-describedby": "project_info_table",
|
|
435
|
-
children: /*#__PURE__*/ (0, $
|
|
436
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Stack), {
|
|
436
437
|
space: 4,
|
|
437
438
|
children: [
|
|
438
|
-
/*#__PURE__*/ (0, $
|
|
439
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
439
440
|
paddingX: 3,
|
|
440
441
|
as: "header",
|
|
441
|
-
children: /*#__PURE__*/ (0, $
|
|
442
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Heading), {
|
|
442
443
|
size: 1,
|
|
443
444
|
as: "h2",
|
|
444
445
|
id: "project_info_table",
|
|
@@ -447,49 +448,49 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
447
448
|
}),
|
|
448
449
|
assembleTableRows.map((item)=>{
|
|
449
450
|
if (!item || !item.rows) return null;
|
|
450
|
-
return /*#__PURE__*/ (0, $
|
|
451
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Stack), {
|
|
451
452
|
space: 3,
|
|
452
453
|
children: [
|
|
453
|
-
/*#__PURE__*/ (0, $
|
|
454
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Card), {
|
|
454
455
|
borderBottom: true,
|
|
455
456
|
padding: 3,
|
|
456
|
-
children: /*#__PURE__*/ (0, $
|
|
457
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Label), {
|
|
457
458
|
size: 0,
|
|
458
459
|
muted: true,
|
|
459
460
|
role: "columnheader",
|
|
460
461
|
children: item.title
|
|
461
462
|
})
|
|
462
463
|
}),
|
|
463
|
-
/*#__PURE__*/ (0, $
|
|
464
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Stack), {
|
|
464
465
|
space: 4,
|
|
465
466
|
paddingX: 3,
|
|
466
467
|
role: "rowgroup",
|
|
467
468
|
children: item.rows.map((row)=>{
|
|
468
|
-
return /*#__PURE__*/ (0, $
|
|
469
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Grid), {
|
|
469
470
|
columns: 2,
|
|
470
471
|
role: "row",
|
|
471
472
|
children: [
|
|
472
|
-
/*#__PURE__*/ (0, $
|
|
473
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
473
474
|
weight: "medium",
|
|
474
475
|
role: "rowheader",
|
|
475
476
|
children: row.title
|
|
476
477
|
}),
|
|
477
|
-
typeof row.value === "object" && /*#__PURE__*/ (0, $
|
|
478
|
+
typeof row.value === "object" && /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
478
479
|
size: 1,
|
|
479
480
|
children: row.value?.error
|
|
480
481
|
}),
|
|
481
|
-
typeof row.value === "string" && /*#__PURE__*/ (0, $
|
|
482
|
-
children: $
|
|
482
|
+
typeof row.value === "string" && /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Fragment), {
|
|
483
|
+
children: $979771a49dfb41e9$var$isUrl(row.value) ? /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
483
484
|
size: 1,
|
|
484
485
|
role: "cell",
|
|
485
486
|
style: {
|
|
486
487
|
wordBreak: "break-word"
|
|
487
488
|
},
|
|
488
|
-
children: /*#__PURE__*/ (0, $
|
|
489
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)("a", {
|
|
489
490
|
href: row.value,
|
|
490
491
|
children: row.value
|
|
491
492
|
})
|
|
492
|
-
}) : /*#__PURE__*/ (0, $
|
|
493
|
+
}) : /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Code), {
|
|
493
494
|
size: 1,
|
|
494
495
|
role: "cell",
|
|
495
496
|
style: {
|
|
@@ -515,10 +516,10 @@ function $72d86a2cfb80e9d7$export$a1c9a67310a2d004(props) {
|
|
|
515
516
|
}
|
|
516
517
|
|
|
517
518
|
|
|
518
|
-
function $
|
|
519
|
+
function $78de0fa9a220e58e$export$66362ea0e7ee12e(config) {
|
|
519
520
|
return {
|
|
520
521
|
name: "project-info",
|
|
521
|
-
component: (0, $
|
|
522
|
+
component: (0, $979771a49dfb41e9$export$a1c9a67310a2d004),
|
|
522
523
|
layout: config?.layout ?? {
|
|
523
524
|
width: "medium"
|
|
524
525
|
}
|
|
@@ -526,9 +527,9 @@ function $ac478372f28acbf6$export$66362ea0e7ee12e(config) {
|
|
|
526
527
|
}
|
|
527
528
|
|
|
528
529
|
|
|
529
|
-
var $
|
|
530
|
+
var $f409fc720124d423$exports = {};
|
|
530
531
|
|
|
531
|
-
$parcel$export($
|
|
532
|
+
$parcel$export($f409fc720124d423$exports, "projectUsersWidget", () => $f409fc720124d423$export$5c0e62d7539f632);
|
|
532
533
|
|
|
533
534
|
|
|
534
535
|
|
|
@@ -539,7 +540,8 @@ $parcel$export($0ef0fb9920ec1f58$exports, "projectUsersWidget", () => $0ef0fb992
|
|
|
539
540
|
|
|
540
541
|
|
|
541
542
|
|
|
542
|
-
|
|
543
|
+
|
|
544
|
+
const $dc6a1647d6dccdcb$var$AvatarWrapper = (0, $7XdDa$styledcomponents)((0, $7XdDa$Card))`
|
|
543
545
|
box-sizing: border-box;
|
|
544
546
|
border-radius: 50%;
|
|
545
547
|
border-color: transparent;
|
|
@@ -552,20 +554,20 @@ const $3a1cbcec6b01611f$var$AvatarWrapper = (0, $5lYf0$styledcomponents)((0, $5l
|
|
|
552
554
|
height: auto;
|
|
553
555
|
}
|
|
554
556
|
`;
|
|
555
|
-
function $
|
|
557
|
+
function $dc6a1647d6dccdcb$var$getInviteUrl(projectId) {
|
|
556
558
|
return `https://manage.sanity.io/projects/${projectId}/team/invite`;
|
|
557
559
|
}
|
|
558
|
-
function $
|
|
559
|
-
const [project, setProject] = (0, $
|
|
560
|
-
const [users, setUsers] = (0, $
|
|
561
|
-
const [error, setError] = (0, $
|
|
562
|
-
const
|
|
563
|
-
const
|
|
564
|
-
const fetchData = (0, $
|
|
560
|
+
function $dc6a1647d6dccdcb$export$2500e0068175e4b9() {
|
|
561
|
+
const [project, setProject] = (0, $7XdDa$useState)();
|
|
562
|
+
const [users, setUsers] = (0, $7XdDa$useState)();
|
|
563
|
+
const [error, setError] = (0, $7XdDa$useState)();
|
|
564
|
+
const userStore = (0, $7XdDa$useUserStore)();
|
|
565
|
+
const versionedClient = (0, $63829e89ad9918b0$export$270fde7c7e72cf26)();
|
|
566
|
+
const fetchData = (0, $7XdDa$useCallback)(()=>{
|
|
565
567
|
const { projectId: projectId } = versionedClient.config();
|
|
566
568
|
const subscription = versionedClient.observable.request({
|
|
567
569
|
uri: `/projects/${projectId}`
|
|
568
|
-
}).pipe((0, $
|
|
570
|
+
}).pipe((0, $7XdDa$switchMap)((_project)=>(0, $7XdDa$from)(userStore.getUsers(_project.members.map((mem)=>mem.id))).pipe((0, $7XdDa$map)((_users)=>({
|
|
569
571
|
project: _project,
|
|
570
572
|
users: _users
|
|
571
573
|
}))))).subscribe({
|
|
@@ -573,7 +575,7 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
573
575
|
setProject(_project);
|
|
574
576
|
setUsers((Array.isArray(_users) ? _users : [
|
|
575
577
|
_users
|
|
576
|
-
]).sort((userA, userB)=>$
|
|
578
|
+
]).sort((userA, userB)=>$dc6a1647d6dccdcb$var$sortUsersByRobotStatus(userA, userB, _project)));
|
|
577
579
|
},
|
|
578
580
|
error: (e)=>setError(e)
|
|
579
581
|
});
|
|
@@ -582,22 +584,22 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
582
584
|
userStore,
|
|
583
585
|
versionedClient
|
|
584
586
|
]);
|
|
585
|
-
(0, $
|
|
587
|
+
(0, $7XdDa$useEffect)(()=>fetchData(), [
|
|
586
588
|
fetchData
|
|
587
589
|
]);
|
|
588
|
-
const handleRetryFetch = (0, $
|
|
590
|
+
const handleRetryFetch = (0, $7XdDa$useCallback)(()=>fetchData(), [
|
|
589
591
|
fetchData
|
|
590
592
|
]);
|
|
591
593
|
const isLoading = !users || !project;
|
|
592
|
-
if (error) return /*#__PURE__*/ (0, $
|
|
594
|
+
if (error) return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $17a16bf8b6a46960$export$67b2e85605d868b2), {
|
|
593
595
|
header: "Project users",
|
|
594
|
-
children: /*#__PURE__*/ (0, $
|
|
596
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
595
597
|
padding: 4,
|
|
596
|
-
children: /*#__PURE__*/ (0, $
|
|
598
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Text), {
|
|
597
599
|
children: [
|
|
598
600
|
"Something went wrong while fetching data. You could",
|
|
599
601
|
" ",
|
|
600
|
-
/*#__PURE__*/ (0, $
|
|
602
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)("a", {
|
|
601
603
|
onClick: handleRetryFetch,
|
|
602
604
|
title: "Retry users fetch",
|
|
603
605
|
style: {
|
|
@@ -610,9 +612,9 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
610
612
|
})
|
|
611
613
|
})
|
|
612
614
|
});
|
|
613
|
-
return /*#__PURE__*/ (0, $
|
|
615
|
+
return /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $17a16bf8b6a46960$export$67b2e85605d868b2), {
|
|
614
616
|
header: "Project users",
|
|
615
|
-
footer: /*#__PURE__*/ (0, $
|
|
617
|
+
footer: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Button), {
|
|
616
618
|
style: {
|
|
617
619
|
width: "100%"
|
|
618
620
|
},
|
|
@@ -623,22 +625,22 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
623
625
|
text: "Invite members",
|
|
624
626
|
as: "a",
|
|
625
627
|
loading: isLoading,
|
|
626
|
-
href: isLoading ? undefined : $
|
|
628
|
+
href: isLoading ? undefined : $dc6a1647d6dccdcb$var$getInviteUrl(project.id)
|
|
627
629
|
}),
|
|
628
630
|
children: [
|
|
629
|
-
isLoading && /*#__PURE__*/ (0, $
|
|
631
|
+
isLoading && /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
630
632
|
paddingY: 5,
|
|
631
633
|
paddingX: 2,
|
|
632
|
-
children: /*#__PURE__*/ (0, $
|
|
634
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Stack), {
|
|
633
635
|
space: 4,
|
|
634
636
|
children: [
|
|
635
|
-
/*#__PURE__*/ (0, $
|
|
637
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
636
638
|
align: "center",
|
|
637
639
|
muted: true,
|
|
638
640
|
size: 1,
|
|
639
|
-
children: /*#__PURE__*/ (0, $
|
|
641
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Spinner), {})
|
|
640
642
|
}),
|
|
641
|
-
/*#__PURE__*/ (0, $
|
|
643
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
642
644
|
align: "center",
|
|
643
645
|
size: 1,
|
|
644
646
|
muted: true,
|
|
@@ -647,23 +649,23 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
647
649
|
]
|
|
648
650
|
})
|
|
649
651
|
}),
|
|
650
|
-
!isLoading && /*#__PURE__*/ (0, $
|
|
652
|
+
!isLoading && /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Stack), {
|
|
651
653
|
space: 3,
|
|
652
654
|
padding: 3,
|
|
653
655
|
children: users?.map((user)=>{
|
|
654
656
|
const membership = project.members.find((member)=>member.id === user.id);
|
|
655
|
-
const media = membership?.isRobot ? /*#__PURE__*/ (0, $
|
|
657
|
+
const media = membership?.isRobot ? /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
656
658
|
size: 3,
|
|
657
|
-
children: /*#__PURE__*/ (0, $
|
|
658
|
-
}) : /*#__PURE__*/ (0, $
|
|
659
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$RobotIcon), {})
|
|
660
|
+
}) : /*#__PURE__*/ (0, $7XdDa$jsx)($dc6a1647d6dccdcb$var$AvatarWrapper, {
|
|
659
661
|
tone: "transparent",
|
|
660
|
-
children: user?.imageUrl && /*#__PURE__*/ (0, $
|
|
662
|
+
children: user?.imageUrl && /*#__PURE__*/ (0, $7XdDa$jsx)("img", {
|
|
661
663
|
src: user.imageUrl,
|
|
662
664
|
alt: user?.displayName
|
|
663
665
|
})
|
|
664
666
|
});
|
|
665
|
-
return /*#__PURE__*/ (0, $
|
|
666
|
-
children: /*#__PURE__*/ (0, $
|
|
667
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
668
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$DefaultPreview), {
|
|
667
669
|
title: user.displayName,
|
|
668
670
|
subtitle: membership?.role,
|
|
669
671
|
media: media
|
|
@@ -674,7 +676,7 @@ function $3a1cbcec6b01611f$export$2500e0068175e4b9() {
|
|
|
674
676
|
]
|
|
675
677
|
});
|
|
676
678
|
}
|
|
677
|
-
function $
|
|
679
|
+
function $dc6a1647d6dccdcb$var$sortUsersByRobotStatus(userA, userB, project) {
|
|
678
680
|
const { members: members } = project;
|
|
679
681
|
const membershipA = members.find((member)=>member.id === userA?.id);
|
|
680
682
|
const membershipB = members.find((member)=>member.id === userB?.id);
|
|
@@ -684,18 +686,18 @@ function $3a1cbcec6b01611f$var$sortUsersByRobotStatus(userA, userB, project) {
|
|
|
684
686
|
}
|
|
685
687
|
|
|
686
688
|
|
|
687
|
-
function $
|
|
689
|
+
function $f409fc720124d423$export$5c0e62d7539f632(config) {
|
|
688
690
|
return {
|
|
689
691
|
name: "project-info",
|
|
690
|
-
component: (0, $
|
|
692
|
+
component: (0, $dc6a1647d6dccdcb$export$2500e0068175e4b9),
|
|
691
693
|
layout: config?.layout
|
|
692
694
|
};
|
|
693
695
|
}
|
|
694
696
|
|
|
695
697
|
|
|
696
|
-
var $
|
|
698
|
+
var $814ac91a32d626ba$exports = {};
|
|
697
699
|
|
|
698
|
-
$parcel$export($
|
|
700
|
+
$parcel$export($814ac91a32d626ba$exports, "sanityTutorialsWidget", () => $814ac91a32d626ba$export$b3552e87a7c5c47b);
|
|
699
701
|
|
|
700
702
|
|
|
701
703
|
|
|
@@ -704,7 +706,7 @@ $parcel$export($dfd7c10d2685c9b1$exports, "sanityTutorialsWidget", () => $dfd7c1
|
|
|
704
706
|
|
|
705
707
|
|
|
706
708
|
|
|
707
|
-
const $
|
|
709
|
+
const $4cea1a19ce247dc2$var$PlayIconBox = (0, $7XdDa$styledcomponents)((0, $7XdDa$Box))`
|
|
708
710
|
position: absolute;
|
|
709
711
|
top: 50%;
|
|
710
712
|
left: 50%;
|
|
@@ -723,21 +725,21 @@ const $f83ecb81d484a8cf$var$PlayIconBox = (0, $5lYf0$styledcomponents)((0, $5lYf
|
|
|
723
725
|
opacity: 0.75;
|
|
724
726
|
}
|
|
725
727
|
`;
|
|
726
|
-
const $
|
|
728
|
+
const $4cea1a19ce247dc2$var$Root = (0, $7XdDa$styledcomponents)((0, $7XdDa$Flex))`
|
|
727
729
|
&:hover {
|
|
728
|
-
${$
|
|
730
|
+
${$4cea1a19ce247dc2$var$PlayIconBox} {
|
|
729
731
|
&:before {
|
|
730
732
|
opacity: 1;
|
|
731
733
|
}
|
|
732
734
|
}
|
|
733
735
|
}
|
|
734
736
|
`;
|
|
735
|
-
const $
|
|
737
|
+
const $4cea1a19ce247dc2$var$PosterCard = (0, $7XdDa$styledcomponents)((0, $7XdDa$Card))`
|
|
736
738
|
width: 100%;
|
|
737
739
|
padding-bottom: calc(9 / 16 * 100%);
|
|
738
740
|
position: relative;
|
|
739
741
|
`;
|
|
740
|
-
const $
|
|
742
|
+
const $4cea1a19ce247dc2$var$Poster = (0, $7XdDa$styledcomponents).img`
|
|
741
743
|
position: absolute;
|
|
742
744
|
top: 0;
|
|
743
745
|
left: 0;
|
|
@@ -750,11 +752,11 @@ const $f83ecb81d484a8cf$var$Poster = (0, $5lYf0$styledcomponents).img`
|
|
|
750
752
|
display: none;
|
|
751
753
|
}
|
|
752
754
|
`;
|
|
753
|
-
function $
|
|
755
|
+
function $4cea1a19ce247dc2$export$825b76de5f2b0345(props) {
|
|
754
756
|
const { title: title , posterURL: posterURL , showPlayIcon: showPlayIcon , href: href , presenterName: presenterName , presenterSubtitle: presenterSubtitle } = props;
|
|
755
|
-
return /*#__PURE__*/ (0, $
|
|
757
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)($4cea1a19ce247dc2$var$Root, {
|
|
756
758
|
flex: 1,
|
|
757
|
-
children: /*#__PURE__*/ (0, $
|
|
759
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Card), {
|
|
758
760
|
sizing: "border",
|
|
759
761
|
flex: 1,
|
|
760
762
|
padding: 2,
|
|
@@ -766,49 +768,49 @@ function $f83ecb81d484a8cf$export$825b76de5f2b0345(props) {
|
|
|
766
768
|
style: {
|
|
767
769
|
position: "relative"
|
|
768
770
|
},
|
|
769
|
-
children: /*#__PURE__*/ (0, $
|
|
771
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Flex), {
|
|
770
772
|
direction: "column",
|
|
771
773
|
style: {
|
|
772
774
|
height: "100%"
|
|
773
775
|
},
|
|
774
776
|
children: [
|
|
775
|
-
posterURL && /*#__PURE__*/ (0, $
|
|
777
|
+
posterURL && /*#__PURE__*/ (0, $7XdDa$jsxs)($4cea1a19ce247dc2$var$PosterCard, {
|
|
776
778
|
marginBottom: 1,
|
|
777
779
|
children: [
|
|
778
|
-
/*#__PURE__*/ (0, $
|
|
780
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)($4cea1a19ce247dc2$var$Poster, {
|
|
779
781
|
src: posterURL
|
|
780
782
|
}),
|
|
781
|
-
showPlayIcon && /*#__PURE__*/ (0, $
|
|
783
|
+
showPlayIcon && /*#__PURE__*/ (0, $7XdDa$jsx)($4cea1a19ce247dc2$var$PlayIconBox, {
|
|
782
784
|
display: "flex",
|
|
783
|
-
children: /*#__PURE__*/ (0, $
|
|
785
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
784
786
|
align: "center",
|
|
785
|
-
children: /*#__PURE__*/ (0, $
|
|
787
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$PlayIcon), {})
|
|
786
788
|
})
|
|
787
789
|
})
|
|
788
790
|
]
|
|
789
791
|
}),
|
|
790
|
-
/*#__PURE__*/ (0, $
|
|
792
|
+
/*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Flex), {
|
|
791
793
|
direction: "column",
|
|
792
794
|
justify: "space-between",
|
|
793
795
|
paddingY: 2,
|
|
794
796
|
flex: 1,
|
|
795
797
|
children: [
|
|
796
|
-
/*#__PURE__*/ (0, $
|
|
798
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Heading), {
|
|
797
799
|
as: "h3",
|
|
798
800
|
size: 1,
|
|
799
801
|
children: title
|
|
800
802
|
}),
|
|
801
|
-
/*#__PURE__*/ (0, $
|
|
803
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Box), {
|
|
802
804
|
marginTop: 4,
|
|
803
|
-
children: /*#__PURE__*/ (0, $
|
|
805
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsxs)((0, $7XdDa$Stack), {
|
|
804
806
|
space: 2,
|
|
805
807
|
flex: 1,
|
|
806
808
|
children: [
|
|
807
|
-
/*#__PURE__*/ (0, $
|
|
809
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
808
810
|
size: 1,
|
|
809
811
|
children: presenterName
|
|
810
812
|
}),
|
|
811
|
-
/*#__PURE__*/ (0, $
|
|
813
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Text), {
|
|
812
814
|
size: 0,
|
|
813
815
|
style: {
|
|
814
816
|
opacity: 0.7
|
|
@@ -830,13 +832,13 @@ function $f83ecb81d484a8cf$export$825b76de5f2b0345(props) {
|
|
|
830
832
|
|
|
831
833
|
|
|
832
834
|
|
|
833
|
-
const $
|
|
835
|
+
const $4f5dff4ed7dc82f6$var$tutorialsProjectConfig = {
|
|
834
836
|
projectId: "3do82whm",
|
|
835
837
|
dataset: "next"
|
|
836
838
|
};
|
|
837
|
-
function $
|
|
838
|
-
const versionedClient = (0, $
|
|
839
|
-
return (0, $
|
|
839
|
+
function $4f5dff4ed7dc82f6$export$144c6e577729d454() {
|
|
840
|
+
const versionedClient = (0, $63829e89ad9918b0$export$270fde7c7e72cf26)();
|
|
841
|
+
return (0, $7XdDa$useMemo)(()=>({
|
|
840
842
|
getFeed: (templateRepoId)=>{
|
|
841
843
|
const uri = templateRepoId ? `/addons/dashboard?templateRepoId=${templateRepoId}` : "/addons/dashboard";
|
|
842
844
|
return versionedClient.observable.request({
|
|
@@ -844,7 +846,7 @@ function $041161d503c3990f$export$144c6e577729d454() {
|
|
|
844
846
|
withCredentials: false
|
|
845
847
|
});
|
|
846
848
|
},
|
|
847
|
-
urlBuilder: (0, $
|
|
849
|
+
urlBuilder: (0, $7XdDa$sanityimageurl)($4f5dff4ed7dc82f6$var$tutorialsProjectConfig)
|
|
848
850
|
}), [
|
|
849
851
|
versionedClient
|
|
850
852
|
]);
|
|
@@ -852,16 +854,16 @@ function $041161d503c3990f$export$144c6e577729d454() {
|
|
|
852
854
|
|
|
853
855
|
|
|
854
856
|
|
|
855
|
-
function $
|
|
857
|
+
function $375b2dfb4ba4a890$var$createUrl(slug, type) {
|
|
856
858
|
if (type === "tutorial") return `https://www.sanity.io/docs/tutorials/${slug.current}`;
|
|
857
859
|
else if (type === "guide") return `https://www.sanity.io/docs/guides/${slug.current}`;
|
|
858
860
|
return false;
|
|
859
861
|
}
|
|
860
|
-
function $
|
|
862
|
+
function $375b2dfb4ba4a890$export$5f156cc357b8467f(props) {
|
|
861
863
|
const { templateRepoId: templateRepoId } = props;
|
|
862
|
-
const [feedItems, setFeedItems] = (0, $
|
|
863
|
-
const { getFeed: getFeed , urlBuilder: urlBuilder } = (0, $
|
|
864
|
-
(0, $
|
|
864
|
+
const [feedItems, setFeedItems] = (0, $7XdDa$useState)([]);
|
|
865
|
+
const { getFeed: getFeed , urlBuilder: urlBuilder } = (0, $4f5dff4ed7dc82f6$export$144c6e577729d454)();
|
|
866
|
+
(0, $7XdDa$useEffect)(()=>{
|
|
865
867
|
const subscription = getFeed(templateRepoId).subscribe((response)=>{
|
|
866
868
|
setFeedItems(response.items);
|
|
867
869
|
});
|
|
@@ -874,9 +876,9 @@ function $e6d104338a42de87$export$5f156cc357b8467f(props) {
|
|
|
874
876
|
templateRepoId
|
|
875
877
|
]);
|
|
876
878
|
const title = "Learn about Sanity";
|
|
877
|
-
return /*#__PURE__*/ (0, $
|
|
879
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $17a16bf8b6a46960$export$67b2e85605d868b2), {
|
|
878
880
|
header: title,
|
|
879
|
-
children: /*#__PURE__*/ (0, $
|
|
881
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Flex), {
|
|
880
882
|
as: "ul",
|
|
881
883
|
overflow: "auto",
|
|
882
884
|
align: "stretch",
|
|
@@ -886,8 +888,8 @@ function $e6d104338a42de87$export$5f156cc357b8467f(props) {
|
|
|
886
888
|
const presenter = feedItem.presenter || feedItem.guideOrTutorial?.presenter || {};
|
|
887
889
|
const subtitle = feedItem.category;
|
|
888
890
|
const { guideOrTutorial: guideOrTutorial = {} } = feedItem;
|
|
889
|
-
const href = (guideOrTutorial.slug ? $
|
|
890
|
-
return /*#__PURE__*/ (0, $
|
|
891
|
+
const href = (guideOrTutorial.slug ? $375b2dfb4ba4a890$var$createUrl(guideOrTutorial.slug, guideOrTutorial._type) : feedItem.externalLink) || feedItem.externalLink;
|
|
892
|
+
return /*#__PURE__*/ (0, $7XdDa$jsx)((0, $7XdDa$Flex), {
|
|
891
893
|
as: "li",
|
|
892
894
|
paddingRight: index < feedItems?.length - 1 ? 1 : 3,
|
|
893
895
|
paddingLeft: index === 0 ? 3 : 0,
|
|
@@ -896,7 +898,7 @@ function $e6d104338a42de87$export$5f156cc357b8467f(props) {
|
|
|
896
898
|
minWidth: 272,
|
|
897
899
|
width: "30%"
|
|
898
900
|
},
|
|
899
|
-
children: /*#__PURE__*/ (0, $
|
|
901
|
+
children: /*#__PURE__*/ (0, $7XdDa$jsx)((0, $4cea1a19ce247dc2$export$825b76de5f2b0345), {
|
|
900
902
|
title: feedItem.title,
|
|
901
903
|
href: href ?? "",
|
|
902
904
|
presenterName: presenter.name,
|
|
@@ -911,10 +913,10 @@ function $e6d104338a42de87$export$5f156cc357b8467f(props) {
|
|
|
911
913
|
}
|
|
912
914
|
|
|
913
915
|
|
|
914
|
-
function $
|
|
916
|
+
function $814ac91a32d626ba$export$b3552e87a7c5c47b(config) {
|
|
915
917
|
return {
|
|
916
918
|
name: "sanity-tutorials",
|
|
917
|
-
component: (0, $
|
|
919
|
+
component: (0, $375b2dfb4ba4a890$export$5f156cc357b8467f),
|
|
918
920
|
layout: config?.layout ?? {
|
|
919
921
|
width: "full"
|
|
920
922
|
}
|
|
@@ -922,11 +924,11 @@ function $dfd7c10d2685c9b1$export$b3552e87a7c5c47b(config) {
|
|
|
922
924
|
}
|
|
923
925
|
|
|
924
926
|
|
|
925
|
-
const $
|
|
927
|
+
const $357f50a17451fe9f$var$strokeStyle = {
|
|
926
928
|
stroke: "currentColor",
|
|
927
929
|
strokeWidth: 1.2
|
|
928
930
|
};
|
|
929
|
-
const $
|
|
931
|
+
const $357f50a17451fe9f$var$DashboardIcon = ()=>/*#__PURE__*/ (0, $7XdDa$jsxs)("svg", {
|
|
930
932
|
"data-sanity-icon": true,
|
|
931
933
|
viewBox: "0 0 25 25",
|
|
932
934
|
fill: "none",
|
|
@@ -935,21 +937,21 @@ const $090815f5086f7f29$var$DashboardIcon = ()=>/*#__PURE__*/ (0, $5lYf0$jsxs)("
|
|
|
935
937
|
width: "1em",
|
|
936
938
|
height: "1em",
|
|
937
939
|
children: [
|
|
938
|
-
/*#__PURE__*/ (0, $
|
|
940
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)("path", {
|
|
939
941
|
d: "M19.5 19.5H5.5V5.5H19.5V19.5Z",
|
|
940
|
-
style: $
|
|
942
|
+
style: $357f50a17451fe9f$var$strokeStyle
|
|
941
943
|
}),
|
|
942
|
-
/*#__PURE__*/ (0, $
|
|
944
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)("path", {
|
|
943
945
|
d: "M5.5 12.5H19.5",
|
|
944
|
-
style: $
|
|
946
|
+
style: $357f50a17451fe9f$var$strokeStyle
|
|
945
947
|
}),
|
|
946
|
-
/*#__PURE__*/ (0, $
|
|
948
|
+
/*#__PURE__*/ (0, $7XdDa$jsx)("path", {
|
|
947
949
|
d: "M14.5 19.5V12.5M10.5 12.5V5.5",
|
|
948
|
-
style: $
|
|
950
|
+
style: $357f50a17451fe9f$var$strokeStyle
|
|
949
951
|
})
|
|
950
952
|
]
|
|
951
953
|
});
|
|
952
|
-
const $
|
|
954
|
+
const $357f50a17451fe9f$export$dd097bc0a3a5adbd = (0, $7XdDa$createPlugin)((config = {})=>{
|
|
953
955
|
const pluginConfig = {
|
|
954
956
|
layout: config.defaultLayout ?? {},
|
|
955
957
|
widgets: config.widgets ?? []
|
|
@@ -962,8 +964,8 @@ const $090815f5086f7f29$export$dd097bc0a3a5adbd = (0, $5lYf0$createPlugin)((conf
|
|
|
962
964
|
{
|
|
963
965
|
title: "Dashboard",
|
|
964
966
|
name: "dashboard",
|
|
965
|
-
icon: $
|
|
966
|
-
component: ()=>/*#__PURE__*/ (0, $
|
|
967
|
+
icon: $357f50a17451fe9f$var$DashboardIcon,
|
|
968
|
+
component: ()=>/*#__PURE__*/ (0, $7XdDa$jsx)((0, $415e81216941c75c$export$fe82a520fc33e5f4), {
|
|
967
969
|
config: pluginConfig
|
|
968
970
|
})
|
|
969
971
|
},
|
|
@@ -973,5 +975,5 @@ const $090815f5086f7f29$export$dd097bc0a3a5adbd = (0, $5lYf0$createPlugin)((conf
|
|
|
973
975
|
});
|
|
974
976
|
|
|
975
977
|
|
|
976
|
-
export {$
|
|
978
|
+
export {$357f50a17451fe9f$export$dd097bc0a3a5adbd as dashboardTool, $17a16bf8b6a46960$export$67b2e85605d868b2 as DashboardWidgetContainer, $78de0fa9a220e58e$export$66362ea0e7ee12e as projectInfoWidget, $f409fc720124d423$export$5c0e62d7539f632 as projectUsersWidget, $814ac91a32d626ba$export$b3552e87a7c5c47b as sanityTutorialsWidget};
|
|
977
979
|
//# sourceMappingURL=index.js.map
|