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