@sanity/dashboard 3.0.0-studio-v3.0 → 3.0.0-studio-v3.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/lib/cjs/index.js +199 -196
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +194 -191
- package/lib/esm/index.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +17 -9
- package/sanity.json +8 -0
- package/src/widgets/projectUsers/ProjectUsers.tsx +7 -8
- package/v2-incompatible.js +11 -0
package/lib/cjs/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
7
|
-
var $
|
|
8
|
-
var $
|
|
9
|
-
var $
|
|
1
|
+
var $dyHF6$reactjsxruntime = require("react/jsx-runtime");
|
|
2
|
+
var $dyHF6$react = require("react");
|
|
3
|
+
var $dyHF6$sanity = require("sanity");
|
|
4
|
+
var $dyHF6$sanityui = require("@sanity/ui");
|
|
5
|
+
var $dyHF6$styledcomponents = require("styled-components");
|
|
6
|
+
var $dyHF6$rxjs = require("rxjs");
|
|
7
|
+
var $dyHF6$rxjsoperators = require("rxjs/operators");
|
|
8
|
+
var $dyHF6$sanityicons = require("@sanity/icons");
|
|
9
|
+
var $dyHF6$sanity_unstable = require("sanity/_unstable");
|
|
10
|
+
var $dyHF6$sanitylibdtssrcdatastores = require("sanity/lib/dts/src/datastores");
|
|
11
|
+
var $dyHF6$sanityimageurl = require("@sanity/image-url");
|
|
10
12
|
|
|
11
13
|
function $parcel$export(e, n, v, s) {
|
|
12
14
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -31,7 +33,7 @@ function $parcel$interopDefault(a) {
|
|
|
31
33
|
return a && a.__esModule ? a.default : a;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
$parcel$export(module.exports, "dashboardTool", () => $
|
|
36
|
+
$parcel$export(module.exports, "dashboardTool", () => $329a1cedcedb1349$export$dd097bc0a3a5adbd);
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
|
|
@@ -39,8 +41,8 @@ $parcel$export(module.exports, "dashboardTool", () => $9233cea927cb9637$export$d
|
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
|
-
function $
|
|
43
|
-
return /*#__PURE__*/ (0, $
|
|
44
|
+
function $93c883afbea98073$export$3469e8c87b54056a(props) {
|
|
45
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Container), {
|
|
44
46
|
width: 4,
|
|
45
47
|
padding: 4,
|
|
46
48
|
sizing: "border",
|
|
@@ -59,46 +61,46 @@ function $bfe45263a984c2cd$export$3469e8c87b54056a(props) {
|
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
const $
|
|
64
|
+
const $57696b1483ff1ea5$export$3d9a716c82234f3d = /*#__PURE__*/ (0, $dyHF6$react.createContext)({
|
|
63
65
|
widgets: []
|
|
64
66
|
});
|
|
65
|
-
function $
|
|
66
|
-
return (0, $
|
|
67
|
+
function $57696b1483ff1ea5$export$f69a0df1904034e() {
|
|
68
|
+
return (0, $dyHF6$react.useContext)($57696b1483ff1ea5$export$3d9a716c82234f3d);
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
|
|
70
72
|
|
|
71
|
-
function $
|
|
72
|
-
const config = (0, $
|
|
73
|
-
const layout = (0, $
|
|
73
|
+
function $eac9c79096489071$export$d320a48219c7c153(props) {
|
|
74
|
+
const config = (0, $57696b1483ff1ea5$export$f69a0df1904034e)();
|
|
75
|
+
const layout = (0, $dyHF6$react.useMemo)(()=>({
|
|
74
76
|
...props.layout || {},
|
|
75
77
|
...config.layout || {}
|
|
76
78
|
}), [
|
|
77
79
|
props.layout,
|
|
78
80
|
config.layout
|
|
79
81
|
]);
|
|
80
|
-
return /*#__PURE__*/ (0, $
|
|
82
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Card), {
|
|
81
83
|
shadow: 1,
|
|
82
84
|
"data-width": layout.width,
|
|
83
85
|
"data-height": layout.height,
|
|
84
|
-
children: /*#__PURE__*/ (0, $
|
|
86
|
+
children: /*#__PURE__*/ (0, $dyHF6$react.createElement)(props.component, {})
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
|
|
89
|
-
const $
|
|
90
|
-
small: (...args)=>(0, $
|
|
91
|
+
const $0c9a17bfc268c430$var$media = {
|
|
92
|
+
small: (...args)=>(0, $dyHF6$styledcomponents.css)`
|
|
91
93
|
@media (min-width: ${({ theme: theme })=>theme.sanity.media[0]}px) {
|
|
92
|
-
${(0, $
|
|
94
|
+
${(0, $dyHF6$styledcomponents.css)(...args)}
|
|
93
95
|
}
|
|
94
96
|
`,
|
|
95
|
-
medium: (...args)=>(0, $
|
|
97
|
+
medium: (...args)=>(0, $dyHF6$styledcomponents.css)`
|
|
96
98
|
@media (min-width: ${({ theme: theme })=>theme.sanity.media[2]}px) {
|
|
97
|
-
${(0, $
|
|
99
|
+
${(0, $dyHF6$styledcomponents.css)(...args)}
|
|
98
100
|
}
|
|
99
101
|
`
|
|
100
102
|
};
|
|
101
|
-
const $
|
|
103
|
+
const $0c9a17bfc268c430$var$Root = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Grid))`
|
|
102
104
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
103
105
|
|
|
104
106
|
& > div {
|
|
@@ -106,76 +108,76 @@ const $b73de53087845311$var$Root = (0, ($parcel$interopDefault($7xGut$styledcomp
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
& > div[data-width='medium'] {
|
|
109
|
-
${$
|
|
111
|
+
${$0c9a17bfc268c430$var$media.small`
|
|
110
112
|
grid-column: span 2;
|
|
111
113
|
`}
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
& > div[data-width='large'] {
|
|
115
|
-
${$
|
|
117
|
+
${$0c9a17bfc268c430$var$media.small`
|
|
116
118
|
grid-column: span 2;
|
|
117
119
|
`}
|
|
118
120
|
|
|
119
|
-
${$
|
|
121
|
+
${$0c9a17bfc268c430$var$media.medium`
|
|
120
122
|
grid-column: span 3;
|
|
121
123
|
`}
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
& > div[data-width='full'] {
|
|
125
|
-
${$
|
|
127
|
+
${$0c9a17bfc268c430$var$media.small`
|
|
126
128
|
grid-column: 1 / -1;
|
|
127
129
|
`}
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
& > div[data-height='medium'] {
|
|
131
|
-
${$
|
|
133
|
+
${$0c9a17bfc268c430$var$media.small`
|
|
132
134
|
grid-row: span 2;
|
|
133
135
|
`}
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
& > div[data-height='large'] {
|
|
137
|
-
${$
|
|
139
|
+
${$0c9a17bfc268c430$var$media.small`
|
|
138
140
|
grid-row: span 2;
|
|
139
141
|
`}
|
|
140
142
|
|
|
141
|
-
${$
|
|
143
|
+
${$0c9a17bfc268c430$var$media.medium`
|
|
142
144
|
grid-row: span 3;
|
|
143
145
|
`}
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
& > div[data-height='full'] {
|
|
147
|
-
${$
|
|
149
|
+
${$0c9a17bfc268c430$var$media.medium`
|
|
148
150
|
grid-row: 1 / -1;
|
|
149
151
|
`}
|
|
150
152
|
}
|
|
151
153
|
`;
|
|
152
|
-
const $
|
|
153
|
-
const $
|
|
154
|
-
function $
|
|
155
|
-
const { config: { layout: layout = $
|
|
156
|
-
return /*#__PURE__*/ (0, $
|
|
154
|
+
const $0c9a17bfc268c430$var$NO_WIDGETS = [];
|
|
155
|
+
const $0c9a17bfc268c430$var$NO_LAYOUT = {};
|
|
156
|
+
function $0c9a17bfc268c430$export$606a10b16bce9144(props) {
|
|
157
|
+
const { config: { layout: layout = $0c9a17bfc268c430$var$NO_LAYOUT , widgets: widgets = $0c9a17bfc268c430$var$NO_WIDGETS } , } = props;
|
|
158
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)($0c9a17bfc268c430$var$Root, {
|
|
157
159
|
autoFlow: "row dense",
|
|
158
160
|
"data-width": layout.width || "auto",
|
|
159
161
|
"data-height": layout.height || "auto",
|
|
160
162
|
gap: 4,
|
|
161
163
|
children: [
|
|
162
|
-
widgets.length ? null : /*#__PURE__*/ (0, $
|
|
164
|
+
widgets.length ? null : /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Card), {
|
|
163
165
|
padding: 4,
|
|
164
166
|
shadow: 1,
|
|
165
167
|
tone: "primary",
|
|
166
|
-
children: /*#__PURE__*/ (0, $
|
|
168
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
167
169
|
align: "center",
|
|
168
170
|
children: "Add some widgets to populate this space."
|
|
169
171
|
})
|
|
170
172
|
}),
|
|
171
173
|
widgets.map((widgetConfig, index)=>{
|
|
172
|
-
if (widgetConfig.type === "__experimental_group") return /*#__PURE__*/ (0, $
|
|
174
|
+
if (widgetConfig.type === "__experimental_group") return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($0c9a17bfc268c430$export$606a10b16bce9144, {
|
|
173
175
|
config: widgetConfig
|
|
174
176
|
}, index);
|
|
175
|
-
if (widgetConfig.component) return /*#__PURE__*/ (0, $
|
|
177
|
+
if (widgetConfig.component) return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $eac9c79096489071$export$d320a48219c7c153), {
|
|
176
178
|
...widgetConfig
|
|
177
179
|
}, index);
|
|
178
|
-
return /*#__PURE__*/ (0, $
|
|
180
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Box), {
|
|
179
181
|
children: [
|
|
180
182
|
widgetConfig.name,
|
|
181
183
|
" is missing widget component"
|
|
@@ -188,12 +190,12 @@ function $b73de53087845311$export$606a10b16bce9144(props) {
|
|
|
188
190
|
|
|
189
191
|
|
|
190
192
|
|
|
191
|
-
function $
|
|
193
|
+
function $91e9efa9de14badb$export$fe82a520fc33e5f4({ config: config }) {
|
|
192
194
|
if (!config) return null;
|
|
193
|
-
return /*#__PURE__*/ (0, $
|
|
195
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $57696b1483ff1ea5$export$3d9a716c82234f3d).Provider, {
|
|
194
196
|
value: config,
|
|
195
|
-
children: /*#__PURE__*/ (0, $
|
|
196
|
-
children: /*#__PURE__*/ (0, $
|
|
197
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $93c883afbea98073$export$3469e8c87b54056a), {
|
|
198
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $0c9a17bfc268c430$export$606a10b16bce9144), {
|
|
197
199
|
config: config
|
|
198
200
|
})
|
|
199
201
|
})
|
|
@@ -202,17 +204,17 @@ function $7aac5747647866ab$export$fe82a520fc33e5f4({ config: config }) {
|
|
|
202
204
|
|
|
203
205
|
|
|
204
206
|
|
|
205
|
-
var $
|
|
207
|
+
var $4ba7065cde0cca68$exports = {};
|
|
206
208
|
|
|
207
209
|
|
|
208
|
-
var $
|
|
210
|
+
var $b40b76121260b241$exports = {};
|
|
209
211
|
|
|
210
|
-
$parcel$export($
|
|
212
|
+
$parcel$export($b40b76121260b241$exports, "DashboardWidgetContainer", () => $b40b76121260b241$export$67b2e85605d868b2);
|
|
211
213
|
|
|
212
214
|
|
|
213
215
|
|
|
214
216
|
|
|
215
|
-
const $
|
|
217
|
+
const $b40b76121260b241$var$Root = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Card))`
|
|
216
218
|
display: flex;
|
|
217
219
|
flex-direction: column;
|
|
218
220
|
justify-content: stretch;
|
|
@@ -220,14 +222,14 @@ const $3e2e9c117db5b41e$var$Root = (0, ($parcel$interopDefault($7xGut$styledcomp
|
|
|
220
222
|
box-sizing: border-box;
|
|
221
223
|
position: relative;
|
|
222
224
|
`;
|
|
223
|
-
const $
|
|
225
|
+
const $b40b76121260b241$var$Header = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Card))`
|
|
224
226
|
position: sticky;
|
|
225
227
|
top: 0;
|
|
226
228
|
z-index: 2;
|
|
227
229
|
border-top-left-radius: inherit;
|
|
228
230
|
border-top-right-radius: inherit;
|
|
229
231
|
`;
|
|
230
|
-
const $
|
|
232
|
+
const $b40b76121260b241$var$Footer = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Card))`
|
|
231
233
|
position: sticky;
|
|
232
234
|
overflow: hidden;
|
|
233
235
|
bottom: 0;
|
|
@@ -236,7 +238,7 @@ const $3e2e9c117db5b41e$var$Footer = (0, ($parcel$interopDefault($7xGut$styledco
|
|
|
236
238
|
border-bottom-left-radius: inherit;
|
|
237
239
|
margin-top: auto;
|
|
238
240
|
`;
|
|
239
|
-
const $
|
|
241
|
+
const $b40b76121260b241$var$Content = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Box))`
|
|
240
242
|
position: relative;
|
|
241
243
|
z-index: 1;
|
|
242
244
|
height: stretch;
|
|
@@ -247,27 +249,27 @@ const $3e2e9c117db5b41e$var$Content = (0, ($parcel$interopDefault($7xGut$styledc
|
|
|
247
249
|
outline: none;
|
|
248
250
|
}
|
|
249
251
|
`;
|
|
250
|
-
const $
|
|
252
|
+
const $b40b76121260b241$export$67b2e85605d868b2 = /*#__PURE__*/ (0, $dyHF6$react.forwardRef)(function DashboardWidgetContainer(props, ref) {
|
|
251
253
|
const { header: header , children: children , footer: footer } = props;
|
|
252
|
-
return /*#__PURE__*/ (0, $
|
|
254
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)($b40b76121260b241$var$Root, {
|
|
253
255
|
radius: 3,
|
|
254
256
|
display: "flex",
|
|
255
257
|
ref: ref,
|
|
256
258
|
children: [
|
|
257
|
-
header && /*#__PURE__*/ (0, $
|
|
259
|
+
header && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($b40b76121260b241$var$Header, {
|
|
258
260
|
borderBottom: true,
|
|
259
261
|
paddingX: 3,
|
|
260
262
|
paddingY: 4,
|
|
261
|
-
children: /*#__PURE__*/ (0, $
|
|
263
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Heading), {
|
|
262
264
|
size: 1,
|
|
263
265
|
textOverflow: "ellipsis",
|
|
264
266
|
children: header
|
|
265
267
|
})
|
|
266
268
|
}),
|
|
267
|
-
children && /*#__PURE__*/ (0, $
|
|
269
|
+
children && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($b40b76121260b241$var$Content, {
|
|
268
270
|
children: children
|
|
269
271
|
}),
|
|
270
|
-
footer && /*#__PURE__*/ (0, $
|
|
272
|
+
footer && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($b40b76121260b241$var$Footer, {
|
|
271
273
|
borderTop: true,
|
|
272
274
|
children: footer
|
|
273
275
|
})
|
|
@@ -276,17 +278,17 @@ const $3e2e9c117db5b41e$export$67b2e85605d868b2 = /*#__PURE__*/ (0, $7xGut$react
|
|
|
276
278
|
});
|
|
277
279
|
|
|
278
280
|
|
|
279
|
-
var $
|
|
281
|
+
var $3b85b98919e996ec$exports = {};
|
|
280
282
|
|
|
281
|
-
$parcel$export($
|
|
283
|
+
$parcel$export($3b85b98919e996ec$exports, "projectInfoWidget", () => $3b85b98919e996ec$export$66362ea0e7ee12e);
|
|
282
284
|
|
|
283
285
|
|
|
284
286
|
|
|
285
287
|
|
|
286
288
|
|
|
287
|
-
function $
|
|
288
|
-
const client = (0, $
|
|
289
|
-
return (0, $
|
|
289
|
+
function $b707d8a93b21430e$export$270fde7c7e72cf26() {
|
|
290
|
+
const client = (0, $dyHF6$sanity.useClient)();
|
|
291
|
+
return (0, $dyHF6$react.useMemo)(()=>client.withConfig({
|
|
290
292
|
apiVersion: "1"
|
|
291
293
|
}), [
|
|
292
294
|
client
|
|
@@ -296,27 +298,27 @@ function $c4f6885a0827c260$export$270fde7c7e72cf26() {
|
|
|
296
298
|
|
|
297
299
|
|
|
298
300
|
|
|
299
|
-
function $
|
|
301
|
+
function $7f8f68c82a66a1d7$var$isUrl(url) {
|
|
300
302
|
return url && /^https?:\/\//.test(`${url}`);
|
|
301
303
|
}
|
|
302
|
-
function $
|
|
304
|
+
function $7f8f68c82a66a1d7$var$getGraphQlUrl(projectId, dataset) {
|
|
303
305
|
return `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
|
|
304
306
|
}
|
|
305
|
-
function $
|
|
307
|
+
function $7f8f68c82a66a1d7$var$getGroqUrl(projectId, dataset) {
|
|
306
308
|
return `https://${projectId}.api.sanity.io/v1/groq/${dataset}`;
|
|
307
309
|
}
|
|
308
|
-
function $
|
|
310
|
+
function $7f8f68c82a66a1d7$var$getManageUrl(projectId) {
|
|
309
311
|
return `https://manage.sanity.io/projects/${projectId}`;
|
|
310
312
|
}
|
|
311
|
-
const $
|
|
312
|
-
const $
|
|
313
|
-
function $
|
|
314
|
-
const { __experimental_before: __experimental_before = $
|
|
315
|
-
const [studioHost, setStudioHost] = (0, $
|
|
316
|
-
const [graphqlApi, setGraphQlApi] = (0, $
|
|
317
|
-
const versionedClient = (0, $
|
|
313
|
+
const $7f8f68c82a66a1d7$var$NO_EXPERIMENTAL = [];
|
|
314
|
+
const $7f8f68c82a66a1d7$var$NO_DATA = [];
|
|
315
|
+
function $7f8f68c82a66a1d7$export$a1c9a67310a2d004(props) {
|
|
316
|
+
const { __experimental_before: __experimental_before = $7f8f68c82a66a1d7$var$NO_EXPERIMENTAL , data: data = $7f8f68c82a66a1d7$var$NO_DATA } = props;
|
|
317
|
+
const [studioHost, setStudioHost] = (0, $dyHF6$react.useState)();
|
|
318
|
+
const [graphqlApi, setGraphQlApi] = (0, $dyHF6$react.useState)();
|
|
319
|
+
const versionedClient = (0, $b707d8a93b21430e$export$270fde7c7e72cf26)();
|
|
318
320
|
const { projectId: projectId = "unknown" , dataset: dataset = "unknown" } = versionedClient.config();
|
|
319
|
-
(0, $
|
|
321
|
+
(0, $dyHF6$react.useEffect)(()=>{
|
|
320
322
|
const subscriptions = [];
|
|
321
323
|
subscriptions.push(versionedClient.observable.request({
|
|
322
324
|
uri: `/projects/${projectId}`
|
|
@@ -337,7 +339,7 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
337
339
|
method: "HEAD",
|
|
338
340
|
uri: `/graphql/${dataset}/default`
|
|
339
341
|
}).subscribe({
|
|
340
|
-
next: ()=>setGraphQlApi($
|
|
342
|
+
next: ()=>setGraphQlApi($7f8f68c82a66a1d7$var$getGraphQlUrl(projectId, dataset)),
|
|
341
343
|
error: (error)=>{
|
|
342
344
|
if (error.statusCode === 404) setGraphQlApi(undefined);
|
|
343
345
|
else {
|
|
@@ -358,7 +360,7 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
358
360
|
setGraphQlApi,
|
|
359
361
|
setStudioHost
|
|
360
362
|
]);
|
|
361
|
-
const assembleTableRows = (0, $
|
|
363
|
+
const assembleTableRows = (0, $dyHF6$react.useMemo)(()=>{
|
|
362
364
|
let result = [
|
|
363
365
|
{
|
|
364
366
|
title: "Sanity project",
|
|
@@ -395,7 +397,7 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
395
397
|
rows: [
|
|
396
398
|
{
|
|
397
399
|
title: "GROQ",
|
|
398
|
-
value: $
|
|
400
|
+
value: $7f8f68c82a66a1d7$var$getGroqUrl(projectId, dataset)
|
|
399
401
|
},
|
|
400
402
|
{
|
|
401
403
|
title: "GraphQL",
|
|
@@ -426,16 +428,16 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
426
428
|
dataset,
|
|
427
429
|
data
|
|
428
430
|
]);
|
|
429
|
-
return /*#__PURE__*/ (0, $
|
|
431
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$reactjsxruntime.Fragment), {
|
|
430
432
|
children: [
|
|
431
|
-
__experimental_before.map((widgetConfig, idx)=>/*#__PURE__*/ (0, $
|
|
433
|
+
__experimental_before.map((widgetConfig, idx)=>/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $eac9c79096489071$export$d320a48219c7c153), {
|
|
432
434
|
...widgetConfig
|
|
433
435
|
}, idx)),
|
|
434
|
-
/*#__PURE__*/ (0, $
|
|
436
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
435
437
|
height: "fill",
|
|
436
438
|
marginTop: __experimental_before?.length > 0 ? 4 : 0,
|
|
437
|
-
children: /*#__PURE__*/ (0, $
|
|
438
|
-
footer: /*#__PURE__*/ (0, $
|
|
439
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $b40b76121260b241$export$67b2e85605d868b2), {
|
|
440
|
+
footer: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Button), {
|
|
439
441
|
style: {
|
|
440
442
|
width: "100%"
|
|
441
443
|
},
|
|
@@ -445,21 +447,21 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
445
447
|
tone: "primary",
|
|
446
448
|
text: "Manage project",
|
|
447
449
|
as: "a",
|
|
448
|
-
href: $
|
|
450
|
+
href: $7f8f68c82a66a1d7$var$getManageUrl(projectId)
|
|
449
451
|
}),
|
|
450
|
-
children: /*#__PURE__*/ (0, $
|
|
452
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Card), {
|
|
451
453
|
paddingY: 4,
|
|
452
454
|
radius: 2,
|
|
453
455
|
role: "table",
|
|
454
456
|
"aria-label": "Project info",
|
|
455
457
|
"aria-describedby": "project_info_table",
|
|
456
|
-
children: /*#__PURE__*/ (0, $
|
|
458
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Stack), {
|
|
457
459
|
space: 4,
|
|
458
460
|
children: [
|
|
459
|
-
/*#__PURE__*/ (0, $
|
|
461
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
460
462
|
paddingX: 3,
|
|
461
463
|
as: "header",
|
|
462
|
-
children: /*#__PURE__*/ (0, $
|
|
464
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Heading), {
|
|
463
465
|
size: 1,
|
|
464
466
|
as: "h2",
|
|
465
467
|
id: "project_info_table",
|
|
@@ -468,49 +470,49 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
468
470
|
}),
|
|
469
471
|
assembleTableRows.map((item)=>{
|
|
470
472
|
if (!item || !item.rows) return null;
|
|
471
|
-
return /*#__PURE__*/ (0, $
|
|
473
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Stack), {
|
|
472
474
|
space: 3,
|
|
473
475
|
children: [
|
|
474
|
-
/*#__PURE__*/ (0, $
|
|
476
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Card), {
|
|
475
477
|
borderBottom: true,
|
|
476
478
|
padding: 3,
|
|
477
|
-
children: /*#__PURE__*/ (0, $
|
|
479
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Label), {
|
|
478
480
|
size: 0,
|
|
479
481
|
muted: true,
|
|
480
482
|
role: "columnheader",
|
|
481
483
|
children: item.title
|
|
482
484
|
})
|
|
483
485
|
}),
|
|
484
|
-
/*#__PURE__*/ (0, $
|
|
486
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Stack), {
|
|
485
487
|
space: 4,
|
|
486
488
|
paddingX: 3,
|
|
487
489
|
role: "rowgroup",
|
|
488
490
|
children: item.rows.map((row)=>{
|
|
489
|
-
return /*#__PURE__*/ (0, $
|
|
491
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Grid), {
|
|
490
492
|
columns: 2,
|
|
491
493
|
role: "row",
|
|
492
494
|
children: [
|
|
493
|
-
/*#__PURE__*/ (0, $
|
|
495
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
494
496
|
weight: "medium",
|
|
495
497
|
role: "rowheader",
|
|
496
498
|
children: row.title
|
|
497
499
|
}),
|
|
498
|
-
typeof row.value === "object" && /*#__PURE__*/ (0, $
|
|
500
|
+
typeof row.value === "object" && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
499
501
|
size: 1,
|
|
500
502
|
children: row.value?.error
|
|
501
503
|
}),
|
|
502
|
-
typeof row.value === "string" && /*#__PURE__*/ (0, $
|
|
503
|
-
children: $
|
|
504
|
+
typeof row.value === "string" && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$reactjsxruntime.Fragment), {
|
|
505
|
+
children: $7f8f68c82a66a1d7$var$isUrl(row.value) ? /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
504
506
|
size: 1,
|
|
505
507
|
role: "cell",
|
|
506
508
|
style: {
|
|
507
509
|
wordBreak: "break-word"
|
|
508
510
|
},
|
|
509
|
-
children: /*#__PURE__*/ (0, $
|
|
511
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("a", {
|
|
510
512
|
href: row.value,
|
|
511
513
|
children: row.value
|
|
512
514
|
})
|
|
513
|
-
}) : /*#__PURE__*/ (0, $
|
|
515
|
+
}) : /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Code), {
|
|
514
516
|
size: 1,
|
|
515
517
|
role: "cell",
|
|
516
518
|
style: {
|
|
@@ -536,10 +538,10 @@ function $2a231b520616890c$export$a1c9a67310a2d004(props) {
|
|
|
536
538
|
}
|
|
537
539
|
|
|
538
540
|
|
|
539
|
-
function $
|
|
541
|
+
function $3b85b98919e996ec$export$66362ea0e7ee12e(config) {
|
|
540
542
|
return {
|
|
541
543
|
name: "project-info",
|
|
542
|
-
component: (0, $
|
|
544
|
+
component: (0, $7f8f68c82a66a1d7$export$a1c9a67310a2d004),
|
|
543
545
|
layout: config?.layout ?? {
|
|
544
546
|
width: "medium"
|
|
545
547
|
}
|
|
@@ -547,9 +549,9 @@ function $16473bba5204ab4f$export$66362ea0e7ee12e(config) {
|
|
|
547
549
|
}
|
|
548
550
|
|
|
549
551
|
|
|
550
|
-
var $
|
|
552
|
+
var $9f0f01baaf74f19a$exports = {};
|
|
551
553
|
|
|
552
|
-
$parcel$export($
|
|
554
|
+
$parcel$export($9f0f01baaf74f19a$exports, "projectUsersWidget", () => $9f0f01baaf74f19a$export$5c0e62d7539f632);
|
|
553
555
|
|
|
554
556
|
|
|
555
557
|
|
|
@@ -560,7 +562,8 @@ $parcel$export($7997b902be105c46$exports, "projectUsersWidget", () => $7997b902b
|
|
|
560
562
|
|
|
561
563
|
|
|
562
564
|
|
|
563
|
-
|
|
565
|
+
|
|
566
|
+
const $0a8433cdd42b1c75$var$AvatarWrapper = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Card))`
|
|
564
567
|
box-sizing: border-box;
|
|
565
568
|
border-radius: 50%;
|
|
566
569
|
border-color: transparent;
|
|
@@ -573,20 +576,20 @@ const $78e6ba7dc9c8c794$var$AvatarWrapper = (0, ($parcel$interopDefault($7xGut$s
|
|
|
573
576
|
height: auto;
|
|
574
577
|
}
|
|
575
578
|
`;
|
|
576
|
-
function $
|
|
579
|
+
function $0a8433cdd42b1c75$var$getInviteUrl(projectId) {
|
|
577
580
|
return `https://manage.sanity.io/projects/${projectId}/team/invite`;
|
|
578
581
|
}
|
|
579
|
-
function $
|
|
580
|
-
const [project, setProject] = (0, $
|
|
581
|
-
const [users, setUsers] = (0, $
|
|
582
|
-
const [error, setError] = (0, $
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
const fetchData = (0, $
|
|
582
|
+
function $0a8433cdd42b1c75$export$2500e0068175e4b9() {
|
|
583
|
+
const [project, setProject] = (0, $dyHF6$react.useState)();
|
|
584
|
+
const [users, setUsers] = (0, $dyHF6$react.useState)();
|
|
585
|
+
const [error, setError] = (0, $dyHF6$react.useState)();
|
|
586
|
+
const userStore = (0, $dyHF6$sanitylibdtssrcdatastores.useUserStore)();
|
|
587
|
+
const versionedClient = (0, $b707d8a93b21430e$export$270fde7c7e72cf26)();
|
|
588
|
+
const fetchData = (0, $dyHF6$react.useCallback)(()=>{
|
|
586
589
|
const { projectId: projectId } = versionedClient.config();
|
|
587
590
|
const subscription = versionedClient.observable.request({
|
|
588
591
|
uri: `/projects/${projectId}`
|
|
589
|
-
}).pipe((0, $
|
|
592
|
+
}).pipe((0, $dyHF6$rxjsoperators.switchMap)((_project)=>(0, $dyHF6$rxjs.from)(userStore.getUsers(_project.members.map((mem)=>mem.id))).pipe((0, $dyHF6$rxjsoperators.map)((_users)=>({
|
|
590
593
|
project: _project,
|
|
591
594
|
users: _users
|
|
592
595
|
}))))).subscribe({
|
|
@@ -594,7 +597,7 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
594
597
|
setProject(_project);
|
|
595
598
|
setUsers((Array.isArray(_users) ? _users : [
|
|
596
599
|
_users
|
|
597
|
-
]).sort((userA, userB)=>$
|
|
600
|
+
]).sort((userA, userB)=>$0a8433cdd42b1c75$var$sortUsersByRobotStatus(userA, userB, _project)));
|
|
598
601
|
},
|
|
599
602
|
error: (e)=>setError(e)
|
|
600
603
|
});
|
|
@@ -603,22 +606,22 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
603
606
|
userStore,
|
|
604
607
|
versionedClient
|
|
605
608
|
]);
|
|
606
|
-
(0, $
|
|
609
|
+
(0, $dyHF6$react.useEffect)(()=>fetchData(), [
|
|
607
610
|
fetchData
|
|
608
611
|
]);
|
|
609
|
-
const handleRetryFetch = (0, $
|
|
612
|
+
const handleRetryFetch = (0, $dyHF6$react.useCallback)(()=>fetchData(), [
|
|
610
613
|
fetchData
|
|
611
614
|
]);
|
|
612
615
|
const isLoading = !users || !project;
|
|
613
|
-
if (error) return /*#__PURE__*/ (0, $
|
|
616
|
+
if (error) return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $b40b76121260b241$export$67b2e85605d868b2), {
|
|
614
617
|
header: "Project users",
|
|
615
|
-
children: /*#__PURE__*/ (0, $
|
|
618
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
616
619
|
padding: 4,
|
|
617
|
-
children: /*#__PURE__*/ (0, $
|
|
620
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Text), {
|
|
618
621
|
children: [
|
|
619
622
|
"Something went wrong while fetching data. You could",
|
|
620
623
|
" ",
|
|
621
|
-
/*#__PURE__*/ (0, $
|
|
624
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("a", {
|
|
622
625
|
onClick: handleRetryFetch,
|
|
623
626
|
title: "Retry users fetch",
|
|
624
627
|
style: {
|
|
@@ -631,9 +634,9 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
631
634
|
})
|
|
632
635
|
})
|
|
633
636
|
});
|
|
634
|
-
return /*#__PURE__*/ (0, $
|
|
637
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $b40b76121260b241$export$67b2e85605d868b2), {
|
|
635
638
|
header: "Project users",
|
|
636
|
-
footer: /*#__PURE__*/ (0, $
|
|
639
|
+
footer: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Button), {
|
|
637
640
|
style: {
|
|
638
641
|
width: "100%"
|
|
639
642
|
},
|
|
@@ -644,22 +647,22 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
644
647
|
text: "Invite members",
|
|
645
648
|
as: "a",
|
|
646
649
|
loading: isLoading,
|
|
647
|
-
href: isLoading ? undefined : $
|
|
650
|
+
href: isLoading ? undefined : $0a8433cdd42b1c75$var$getInviteUrl(project.id)
|
|
648
651
|
}),
|
|
649
652
|
children: [
|
|
650
|
-
isLoading && /*#__PURE__*/ (0, $
|
|
653
|
+
isLoading && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
651
654
|
paddingY: 5,
|
|
652
655
|
paddingX: 2,
|
|
653
|
-
children: /*#__PURE__*/ (0, $
|
|
656
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Stack), {
|
|
654
657
|
space: 4,
|
|
655
658
|
children: [
|
|
656
|
-
/*#__PURE__*/ (0, $
|
|
659
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
657
660
|
align: "center",
|
|
658
661
|
muted: true,
|
|
659
662
|
size: 1,
|
|
660
|
-
children: /*#__PURE__*/ (0, $
|
|
663
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Spinner), {})
|
|
661
664
|
}),
|
|
662
|
-
/*#__PURE__*/ (0, $
|
|
665
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
663
666
|
align: "center",
|
|
664
667
|
size: 1,
|
|
665
668
|
muted: true,
|
|
@@ -668,23 +671,23 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
668
671
|
]
|
|
669
672
|
})
|
|
670
673
|
}),
|
|
671
|
-
!isLoading && /*#__PURE__*/ (0, $
|
|
674
|
+
!isLoading && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Stack), {
|
|
672
675
|
space: 3,
|
|
673
676
|
padding: 3,
|
|
674
677
|
children: users?.map((user)=>{
|
|
675
678
|
const membership = project.members.find((member)=>member.id === user.id);
|
|
676
|
-
const media = membership?.isRobot ? /*#__PURE__*/ (0, $
|
|
679
|
+
const media = membership?.isRobot ? /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
677
680
|
size: 3,
|
|
678
|
-
children: /*#__PURE__*/ (0, $
|
|
679
|
-
}) : /*#__PURE__*/ (0, $
|
|
681
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityicons.RobotIcon), {})
|
|
682
|
+
}) : /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($0a8433cdd42b1c75$var$AvatarWrapper, {
|
|
680
683
|
tone: "transparent",
|
|
681
|
-
children: user?.imageUrl && /*#__PURE__*/ (0, $
|
|
684
|
+
children: user?.imageUrl && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("img", {
|
|
682
685
|
src: user.imageUrl,
|
|
683
686
|
alt: user?.displayName
|
|
684
687
|
})
|
|
685
688
|
});
|
|
686
|
-
return /*#__PURE__*/ (0, $
|
|
687
|
-
children: /*#__PURE__*/ (0, $
|
|
689
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
690
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanity_unstable.DefaultPreview), {
|
|
688
691
|
title: user.displayName,
|
|
689
692
|
subtitle: membership?.role,
|
|
690
693
|
media: media
|
|
@@ -695,7 +698,7 @@ function $78e6ba7dc9c8c794$export$2500e0068175e4b9() {
|
|
|
695
698
|
]
|
|
696
699
|
});
|
|
697
700
|
}
|
|
698
|
-
function $
|
|
701
|
+
function $0a8433cdd42b1c75$var$sortUsersByRobotStatus(userA, userB, project) {
|
|
699
702
|
const { members: members } = project;
|
|
700
703
|
const membershipA = members.find((member)=>member.id === userA?.id);
|
|
701
704
|
const membershipB = members.find((member)=>member.id === userB?.id);
|
|
@@ -705,18 +708,18 @@ function $78e6ba7dc9c8c794$var$sortUsersByRobotStatus(userA, userB, project) {
|
|
|
705
708
|
}
|
|
706
709
|
|
|
707
710
|
|
|
708
|
-
function $
|
|
711
|
+
function $9f0f01baaf74f19a$export$5c0e62d7539f632(config) {
|
|
709
712
|
return {
|
|
710
713
|
name: "project-info",
|
|
711
|
-
component: (0, $
|
|
714
|
+
component: (0, $0a8433cdd42b1c75$export$2500e0068175e4b9),
|
|
712
715
|
layout: config?.layout
|
|
713
716
|
};
|
|
714
717
|
}
|
|
715
718
|
|
|
716
719
|
|
|
717
|
-
var $
|
|
720
|
+
var $1000d7b311eba884$exports = {};
|
|
718
721
|
|
|
719
|
-
$parcel$export($
|
|
722
|
+
$parcel$export($1000d7b311eba884$exports, "sanityTutorialsWidget", () => $1000d7b311eba884$export$b3552e87a7c5c47b);
|
|
720
723
|
|
|
721
724
|
|
|
722
725
|
|
|
@@ -725,7 +728,7 @@ $parcel$export($1606a83fb83c2d1a$exports, "sanityTutorialsWidget", () => $1606a8
|
|
|
725
728
|
|
|
726
729
|
|
|
727
730
|
|
|
728
|
-
const $
|
|
731
|
+
const $f7904e4c8f3104b2$var$PlayIconBox = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Box))`
|
|
729
732
|
position: absolute;
|
|
730
733
|
top: 50%;
|
|
731
734
|
left: 50%;
|
|
@@ -744,21 +747,21 @@ const $0fded2095eda9a02$var$PlayIconBox = (0, ($parcel$interopDefault($7xGut$sty
|
|
|
744
747
|
opacity: 0.75;
|
|
745
748
|
}
|
|
746
749
|
`;
|
|
747
|
-
const $
|
|
750
|
+
const $f7904e4c8f3104b2$var$Root = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Flex))`
|
|
748
751
|
&:hover {
|
|
749
|
-
${$
|
|
752
|
+
${$f7904e4c8f3104b2$var$PlayIconBox} {
|
|
750
753
|
&:before {
|
|
751
754
|
opacity: 1;
|
|
752
755
|
}
|
|
753
756
|
}
|
|
754
757
|
}
|
|
755
758
|
`;
|
|
756
|
-
const $
|
|
759
|
+
const $f7904e4c8f3104b2$var$PosterCard = (0, ($parcel$interopDefault($dyHF6$styledcomponents)))((0, $dyHF6$sanityui.Card))`
|
|
757
760
|
width: 100%;
|
|
758
761
|
padding-bottom: calc(9 / 16 * 100%);
|
|
759
762
|
position: relative;
|
|
760
763
|
`;
|
|
761
|
-
const $
|
|
764
|
+
const $f7904e4c8f3104b2$var$Poster = (0, ($parcel$interopDefault($dyHF6$styledcomponents))).img`
|
|
762
765
|
position: absolute;
|
|
763
766
|
top: 0;
|
|
764
767
|
left: 0;
|
|
@@ -771,11 +774,11 @@ const $0fded2095eda9a02$var$Poster = (0, ($parcel$interopDefault($7xGut$styledco
|
|
|
771
774
|
display: none;
|
|
772
775
|
}
|
|
773
776
|
`;
|
|
774
|
-
function $
|
|
777
|
+
function $f7904e4c8f3104b2$export$825b76de5f2b0345(props) {
|
|
775
778
|
const { title: title , posterURL: posterURL , showPlayIcon: showPlayIcon , href: href , presenterName: presenterName , presenterSubtitle: presenterSubtitle } = props;
|
|
776
|
-
return /*#__PURE__*/ (0, $
|
|
779
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($f7904e4c8f3104b2$var$Root, {
|
|
777
780
|
flex: 1,
|
|
778
|
-
children: /*#__PURE__*/ (0, $
|
|
781
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Card), {
|
|
779
782
|
sizing: "border",
|
|
780
783
|
flex: 1,
|
|
781
784
|
padding: 2,
|
|
@@ -787,49 +790,49 @@ function $0fded2095eda9a02$export$825b76de5f2b0345(props) {
|
|
|
787
790
|
style: {
|
|
788
791
|
position: "relative"
|
|
789
792
|
},
|
|
790
|
-
children: /*#__PURE__*/ (0, $
|
|
793
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Flex), {
|
|
791
794
|
direction: "column",
|
|
792
795
|
style: {
|
|
793
796
|
height: "100%"
|
|
794
797
|
},
|
|
795
798
|
children: [
|
|
796
|
-
posterURL && /*#__PURE__*/ (0, $
|
|
799
|
+
posterURL && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)($f7904e4c8f3104b2$var$PosterCard, {
|
|
797
800
|
marginBottom: 1,
|
|
798
801
|
children: [
|
|
799
|
-
/*#__PURE__*/ (0, $
|
|
802
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($f7904e4c8f3104b2$var$Poster, {
|
|
800
803
|
src: posterURL
|
|
801
804
|
}),
|
|
802
|
-
showPlayIcon && /*#__PURE__*/ (0, $
|
|
805
|
+
showPlayIcon && /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)($f7904e4c8f3104b2$var$PlayIconBox, {
|
|
803
806
|
display: "flex",
|
|
804
|
-
children: /*#__PURE__*/ (0, $
|
|
807
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
805
808
|
align: "center",
|
|
806
|
-
children: /*#__PURE__*/ (0, $
|
|
809
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityicons.PlayIcon), {})
|
|
807
810
|
})
|
|
808
811
|
})
|
|
809
812
|
]
|
|
810
813
|
}),
|
|
811
|
-
/*#__PURE__*/ (0, $
|
|
814
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Flex), {
|
|
812
815
|
direction: "column",
|
|
813
816
|
justify: "space-between",
|
|
814
817
|
paddingY: 2,
|
|
815
818
|
flex: 1,
|
|
816
819
|
children: [
|
|
817
|
-
/*#__PURE__*/ (0, $
|
|
820
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Heading), {
|
|
818
821
|
as: "h3",
|
|
819
822
|
size: 1,
|
|
820
823
|
children: title
|
|
821
824
|
}),
|
|
822
|
-
/*#__PURE__*/ (0, $
|
|
825
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Box), {
|
|
823
826
|
marginTop: 4,
|
|
824
|
-
children: /*#__PURE__*/ (0, $
|
|
827
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)((0, $dyHF6$sanityui.Stack), {
|
|
825
828
|
space: 2,
|
|
826
829
|
flex: 1,
|
|
827
830
|
children: [
|
|
828
|
-
/*#__PURE__*/ (0, $
|
|
831
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
829
832
|
size: 1,
|
|
830
833
|
children: presenterName
|
|
831
834
|
}),
|
|
832
|
-
/*#__PURE__*/ (0, $
|
|
835
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Text), {
|
|
833
836
|
size: 0,
|
|
834
837
|
style: {
|
|
835
838
|
opacity: 0.7
|
|
@@ -851,13 +854,13 @@ function $0fded2095eda9a02$export$825b76de5f2b0345(props) {
|
|
|
851
854
|
|
|
852
855
|
|
|
853
856
|
|
|
854
|
-
const $
|
|
857
|
+
const $03a20cc8653e0692$var$tutorialsProjectConfig = {
|
|
855
858
|
projectId: "3do82whm",
|
|
856
859
|
dataset: "next"
|
|
857
860
|
};
|
|
858
|
-
function $
|
|
859
|
-
const versionedClient = (0, $
|
|
860
|
-
return (0, $
|
|
861
|
+
function $03a20cc8653e0692$export$144c6e577729d454() {
|
|
862
|
+
const versionedClient = (0, $b707d8a93b21430e$export$270fde7c7e72cf26)();
|
|
863
|
+
return (0, $dyHF6$react.useMemo)(()=>({
|
|
861
864
|
getFeed: (templateRepoId)=>{
|
|
862
865
|
const uri = templateRepoId ? `/addons/dashboard?templateRepoId=${templateRepoId}` : "/addons/dashboard";
|
|
863
866
|
return versionedClient.observable.request({
|
|
@@ -865,7 +868,7 @@ function $9bf75aece3449dab$export$144c6e577729d454() {
|
|
|
865
868
|
withCredentials: false
|
|
866
869
|
});
|
|
867
870
|
},
|
|
868
|
-
urlBuilder: (0, ($parcel$interopDefault($
|
|
871
|
+
urlBuilder: (0, ($parcel$interopDefault($dyHF6$sanityimageurl)))($03a20cc8653e0692$var$tutorialsProjectConfig)
|
|
869
872
|
}), [
|
|
870
873
|
versionedClient
|
|
871
874
|
]);
|
|
@@ -873,16 +876,16 @@ function $9bf75aece3449dab$export$144c6e577729d454() {
|
|
|
873
876
|
|
|
874
877
|
|
|
875
878
|
|
|
876
|
-
function $
|
|
879
|
+
function $9c397f58297d9297$var$createUrl(slug, type) {
|
|
877
880
|
if (type === "tutorial") return `https://www.sanity.io/docs/tutorials/${slug.current}`;
|
|
878
881
|
else if (type === "guide") return `https://www.sanity.io/docs/guides/${slug.current}`;
|
|
879
882
|
return false;
|
|
880
883
|
}
|
|
881
|
-
function $
|
|
884
|
+
function $9c397f58297d9297$export$5f156cc357b8467f(props) {
|
|
882
885
|
const { templateRepoId: templateRepoId } = props;
|
|
883
|
-
const [feedItems, setFeedItems] = (0, $
|
|
884
|
-
const { getFeed: getFeed , urlBuilder: urlBuilder } = (0, $
|
|
885
|
-
(0, $
|
|
886
|
+
const [feedItems, setFeedItems] = (0, $dyHF6$react.useState)([]);
|
|
887
|
+
const { getFeed: getFeed , urlBuilder: urlBuilder } = (0, $03a20cc8653e0692$export$144c6e577729d454)();
|
|
888
|
+
(0, $dyHF6$react.useEffect)(()=>{
|
|
886
889
|
const subscription = getFeed(templateRepoId).subscribe((response)=>{
|
|
887
890
|
setFeedItems(response.items);
|
|
888
891
|
});
|
|
@@ -895,9 +898,9 @@ function $a7c779803cabaa01$export$5f156cc357b8467f(props) {
|
|
|
895
898
|
templateRepoId
|
|
896
899
|
]);
|
|
897
900
|
const title = "Learn about Sanity";
|
|
898
|
-
return /*#__PURE__*/ (0, $
|
|
901
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $b40b76121260b241$export$67b2e85605d868b2), {
|
|
899
902
|
header: title,
|
|
900
|
-
children: /*#__PURE__*/ (0, $
|
|
903
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Flex), {
|
|
901
904
|
as: "ul",
|
|
902
905
|
overflow: "auto",
|
|
903
906
|
align: "stretch",
|
|
@@ -907,8 +910,8 @@ function $a7c779803cabaa01$export$5f156cc357b8467f(props) {
|
|
|
907
910
|
const presenter = feedItem.presenter || feedItem.guideOrTutorial?.presenter || {};
|
|
908
911
|
const subtitle = feedItem.category;
|
|
909
912
|
const { guideOrTutorial: guideOrTutorial = {} } = feedItem;
|
|
910
|
-
const href = (guideOrTutorial.slug ? $
|
|
911
|
-
return /*#__PURE__*/ (0, $
|
|
913
|
+
const href = (guideOrTutorial.slug ? $9c397f58297d9297$var$createUrl(guideOrTutorial.slug, guideOrTutorial._type) : feedItem.externalLink) || feedItem.externalLink;
|
|
914
|
+
return /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $dyHF6$sanityui.Flex), {
|
|
912
915
|
as: "li",
|
|
913
916
|
paddingRight: index < feedItems?.length - 1 ? 1 : 3,
|
|
914
917
|
paddingLeft: index === 0 ? 3 : 0,
|
|
@@ -917,7 +920,7 @@ function $a7c779803cabaa01$export$5f156cc357b8467f(props) {
|
|
|
917
920
|
minWidth: 272,
|
|
918
921
|
width: "30%"
|
|
919
922
|
},
|
|
920
|
-
children: /*#__PURE__*/ (0, $
|
|
923
|
+
children: /*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $f7904e4c8f3104b2$export$825b76de5f2b0345), {
|
|
921
924
|
title: feedItem.title,
|
|
922
925
|
href: href ?? "",
|
|
923
926
|
presenterName: presenter.name,
|
|
@@ -932,10 +935,10 @@ function $a7c779803cabaa01$export$5f156cc357b8467f(props) {
|
|
|
932
935
|
}
|
|
933
936
|
|
|
934
937
|
|
|
935
|
-
function $
|
|
938
|
+
function $1000d7b311eba884$export$b3552e87a7c5c47b(config) {
|
|
936
939
|
return {
|
|
937
940
|
name: "sanity-tutorials",
|
|
938
|
-
component: (0, $
|
|
941
|
+
component: (0, $9c397f58297d9297$export$5f156cc357b8467f),
|
|
939
942
|
layout: config?.layout ?? {
|
|
940
943
|
width: "full"
|
|
941
944
|
}
|
|
@@ -943,11 +946,11 @@ function $1606a83fb83c2d1a$export$b3552e87a7c5c47b(config) {
|
|
|
943
946
|
}
|
|
944
947
|
|
|
945
948
|
|
|
946
|
-
const $
|
|
949
|
+
const $329a1cedcedb1349$var$strokeStyle = {
|
|
947
950
|
stroke: "currentColor",
|
|
948
951
|
strokeWidth: 1.2
|
|
949
952
|
};
|
|
950
|
-
const $
|
|
953
|
+
const $329a1cedcedb1349$var$DashboardIcon = ()=>/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsxs)("svg", {
|
|
951
954
|
"data-sanity-icon": true,
|
|
952
955
|
viewBox: "0 0 25 25",
|
|
953
956
|
fill: "none",
|
|
@@ -956,21 +959,21 @@ const $9233cea927cb9637$var$DashboardIcon = ()=>/*#__PURE__*/ (0, $7xGut$reactjs
|
|
|
956
959
|
width: "1em",
|
|
957
960
|
height: "1em",
|
|
958
961
|
children: [
|
|
959
|
-
/*#__PURE__*/ (0, $
|
|
962
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("path", {
|
|
960
963
|
d: "M19.5 19.5H5.5V5.5H19.5V19.5Z",
|
|
961
|
-
style: $
|
|
964
|
+
style: $329a1cedcedb1349$var$strokeStyle
|
|
962
965
|
}),
|
|
963
|
-
/*#__PURE__*/ (0, $
|
|
966
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("path", {
|
|
964
967
|
d: "M5.5 12.5H19.5",
|
|
965
|
-
style: $
|
|
968
|
+
style: $329a1cedcedb1349$var$strokeStyle
|
|
966
969
|
}),
|
|
967
|
-
/*#__PURE__*/ (0, $
|
|
970
|
+
/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)("path", {
|
|
968
971
|
d: "M14.5 19.5V12.5M10.5 12.5V5.5",
|
|
969
|
-
style: $
|
|
972
|
+
style: $329a1cedcedb1349$var$strokeStyle
|
|
970
973
|
})
|
|
971
974
|
]
|
|
972
975
|
});
|
|
973
|
-
const $
|
|
976
|
+
const $329a1cedcedb1349$export$dd097bc0a3a5adbd = (0, $dyHF6$sanity.createPlugin)((config = {})=>{
|
|
974
977
|
const pluginConfig = {
|
|
975
978
|
layout: config.defaultLayout ?? {},
|
|
976
979
|
widgets: config.widgets ?? []
|
|
@@ -983,8 +986,8 @@ const $9233cea927cb9637$export$dd097bc0a3a5adbd = (0, $7xGut$sanity.createPlugin
|
|
|
983
986
|
{
|
|
984
987
|
title: "Dashboard",
|
|
985
988
|
name: "dashboard",
|
|
986
|
-
icon: $
|
|
987
|
-
component: ()=>/*#__PURE__*/ (0, $
|
|
989
|
+
icon: $329a1cedcedb1349$var$DashboardIcon,
|
|
990
|
+
component: ()=>/*#__PURE__*/ (0, $dyHF6$reactjsxruntime.jsx)((0, $91e9efa9de14badb$export$fe82a520fc33e5f4), {
|
|
988
991
|
config: pluginConfig
|
|
989
992
|
})
|
|
990
993
|
},
|
|
@@ -992,11 +995,11 @@ const $9233cea927cb9637$export$dd097bc0a3a5adbd = (0, $7xGut$sanity.createPlugin
|
|
|
992
995
|
}
|
|
993
996
|
};
|
|
994
997
|
});
|
|
995
|
-
$parcel$exportWildcard(module.exports, $
|
|
996
|
-
$parcel$exportWildcard(module.exports, $
|
|
997
|
-
$parcel$exportWildcard(module.exports, $
|
|
998
|
-
$parcel$exportWildcard(module.exports, $
|
|
999
|
-
$parcel$exportWildcard(module.exports, $
|
|
998
|
+
$parcel$exportWildcard(module.exports, $4ba7065cde0cca68$exports);
|
|
999
|
+
$parcel$exportWildcard(module.exports, $b40b76121260b241$exports);
|
|
1000
|
+
$parcel$exportWildcard(module.exports, $3b85b98919e996ec$exports);
|
|
1001
|
+
$parcel$exportWildcard(module.exports, $9f0f01baaf74f19a$exports);
|
|
1002
|
+
$parcel$exportWildcard(module.exports, $1000d7b311eba884$exports);
|
|
1000
1003
|
|
|
1001
1004
|
|
|
1002
1005
|
//# sourceMappingURL=index.js.map
|