@sanity/dashboard 6.0.6 → 6.0.7

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/dist/index.js CHANGED
@@ -1,609 +1,753 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
1
+ import { createContext, useContext, useEffect, useState } from "react";
2
2
  import { c } from "react/compiler-runtime";
3
- import { Card, Heading, Box, Stack, Label, Grid, Text, Code, Button, Flex, rem, Spinner, Container } from "@sanity/ui";
3
+ import { Box, Button, Card, Code, Container, Flex, Grid, Heading, Label, Spinner, Stack, Text, rem } from "@sanity/ui";
4
4
  import { getTheme_v2 } from "@sanity/ui/theme";
5
- import { styled, css } from "styled-components";
6
- import { createContext, useContext, useState, useEffect } from "react";
7
- import { useClient, useListFormat, UserAvatar, useUserStore, definePlugin } from "sanity";
5
+ import { css, styled } from "styled-components";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
7
  import { from } from "rxjs";
9
- import { switchMap, map } from "rxjs/operators";
8
+ import { UserAvatar, definePlugin, useClient, useListFormat, useUserStore } from "sanity";
9
+ import { map, switchMap } from "rxjs/operators";
10
10
  import { RobotIcon } from "@sanity/icons/Robot";
11
11
  import { createImageUrlBuilder } from "@sanity/image-url";
12
12
  import { PlayIcon } from "@sanity/icons/Play";
13
- const Root$3 = /* @__PURE__ */ styled(Card).withConfig({
14
- displayName: "Root",
15
- componentId: "sc-stlwez-0"
16
- })(["display:flex;flex-direction:column;justify-content:stretch;height:100%;box-sizing:border-box;position:relative;"]), Header = /* @__PURE__ */ styled(Card).withConfig({
17
- displayName: "Header",
18
- componentId: "sc-stlwez-1"
19
- })(["position:sticky;top:0;z-index:2;border-top-left-radius:inherit;border-top-right-radius:inherit;"]), Footer = /* @__PURE__ */ styled(Card).withConfig({
20
- displayName: "Footer",
21
- componentId: "sc-stlwez-2"
22
- })(["position:sticky;overflow:hidden;bottom:0;z-index:2;border-bottom-right-radius:inherit;border-bottom-left-radius:inherit;margin-top:auto;"]), Content = /* @__PURE__ */ styled(Box).withConfig({
23
- displayName: "Content",
24
- componentId: "sc-stlwez-3"
25
- })(["position:relative;z-index:1;height:stretch;min-height:21.5em;@media (min-width:", "px){overflow-y:auto;outline:none;}"], ({
26
- theme
27
- }) => getTheme_v2(theme).media[0]);
13
+ const Root$3 = styled(Card).withConfig({
14
+ displayName: "Root",
15
+ componentId: "sc-41rfei-0"
16
+ })`display:flex;flex-direction:column;justify-content:stretch;height:100%;box-sizing:border-box;position:relative;`, Header = styled(Card).withConfig({
17
+ displayName: "Header",
18
+ componentId: "sc-41rfei-1"
19
+ })`position:sticky;top:0;z-index:2;border-top-left-radius:inherit;border-top-right-radius:inherit;`, Footer = styled(Card).withConfig({
20
+ displayName: "Footer",
21
+ componentId: "sc-41rfei-2"
22
+ })`position:sticky;overflow:hidden;bottom:0;z-index:2;border-bottom-right-radius:inherit;border-bottom-left-radius:inherit;margin-top:auto;`, Content = styled(Box).withConfig({
23
+ displayName: "Content",
24
+ componentId: "sc-41rfei-3"
25
+ })`position:relative;z-index:1;height:stretch;min-height:21.5em;@media (min-width:${({ theme }) => getTheme_v2(theme).media[0]}px){overflow-y:auto;outline:none;}`;
28
26
  function DashboardWidgetContainer(props) {
29
- const $ = c(11), {
30
- header,
31
- children,
32
- footer,
33
- ref
34
- } = props;
35
- let t0;
36
- $[0] !== header ? (t0 = header && /* @__PURE__ */ jsx(Header, { borderBottom: !0, paddingX: 3, paddingY: 4, children: /* @__PURE__ */ jsx(Heading, { size: 1, textOverflow: "ellipsis", children: header }) }), $[0] = header, $[1] = t0) : t0 = $[1];
37
- let t1;
38
- $[2] !== children ? (t1 = children && /* @__PURE__ */ jsx(Content, { children }), $[2] = children, $[3] = t1) : t1 = $[3];
39
- let t2;
40
- $[4] !== footer ? (t2 = footer && /* @__PURE__ */ jsx(Footer, { borderTop: !0, children: footer }), $[4] = footer, $[5] = t2) : t2 = $[5];
41
- let t3;
42
- return $[6] !== ref || $[7] !== t0 || $[8] !== t1 || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsxs(Root$3, { radius: 3, display: "flex", ref, children: [
43
- t0,
44
- t1,
45
- t2
46
- ] }), $[6] = ref, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
47
- }
48
- const DashboardContext = createContext({
49
- widgets: []
50
- });
27
+ let $ = c(11), { header, children, footer, ref } = props, t0;
28
+ $[0] === header ? t0 = $[1] : (t0 = header && /* @__PURE__ */ jsx(Header, {
29
+ borderBottom: !0,
30
+ paddingX: 3,
31
+ paddingY: 4,
32
+ children: /* @__PURE__ */ jsx(Heading, {
33
+ size: 1,
34
+ textOverflow: "ellipsis",
35
+ children: header
36
+ })
37
+ }), $[0] = header, $[1] = t0);
38
+ let t1;
39
+ $[2] === children ? t1 = $[3] : (t1 = children && /* @__PURE__ */ jsx(Content, { children }), $[2] = children, $[3] = t1);
40
+ let t2;
41
+ $[4] === footer ? t2 = $[5] : (t2 = footer && /* @__PURE__ */ jsx(Footer, {
42
+ borderTop: !0,
43
+ children: footer
44
+ }), $[4] = footer, $[5] = t2);
45
+ let t3;
46
+ return $[6] !== ref || $[7] !== t0 || $[8] !== t1 || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsxs(Root$3, {
47
+ radius: 3,
48
+ display: "flex",
49
+ ref,
50
+ children: [
51
+ t0,
52
+ t1,
53
+ t2
54
+ ]
55
+ }), $[6] = ref, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
56
+ }
57
+ const DashboardContext = createContext({ widgets: [] });
51
58
  function useDashboardConfig() {
52
- return useContext(DashboardContext);
59
+ return useContext(DashboardContext);
53
60
  }
54
61
  function WidgetContainer(props) {
55
- const $ = c(9), config = useDashboardConfig();
56
- let t0;
57
- $[0] !== config.layout || $[1] !== props.layout ? (t0 = {
58
- ...props.layout,
59
- ...config.layout
60
- }, $[0] = config.layout, $[1] = props.layout, $[2] = t0) : t0 = $[2];
61
- const layout = t0, Widget = props.component;
62
- let t1;
63
- $[3] !== Widget ? (t1 = /* @__PURE__ */ jsx(Widget, {}), $[3] = Widget, $[4] = t1) : t1 = $[4];
64
- let t2;
65
- return $[5] !== layout.height || $[6] !== layout.width || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsx(Card, { shadow: 1, "data-width": layout.width, "data-height": layout.height, children: t1 }), $[5] = layout.height, $[6] = layout.width, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
62
+ let $ = c(9), config = useDashboardConfig(), t0;
63
+ $[0] !== config.layout || $[1] !== props.layout ? (t0 = {
64
+ ...props.layout,
65
+ ...config.layout
66
+ }, $[0] = config.layout, $[1] = props.layout, $[2] = t0) : t0 = $[2];
67
+ let layout = t0, Widget = props.component, t1;
68
+ $[3] === Widget ? t1 = $[4] : (t1 = /* @__PURE__ */ jsx(Widget, {}), $[3] = Widget, $[4] = t1);
69
+ let t2;
70
+ return $[5] !== layout.height || $[6] !== layout.width || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsx(Card, {
71
+ shadow: 1,
72
+ "data-width": layout.width,
73
+ "data-height": layout.height,
74
+ children: t1
75
+ }), $[5] = layout.height, $[6] = layout.width, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
66
76
  }
67
77
  function useVersionedClient() {
68
- const $ = c(1);
69
- let t0;
70
- return $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = {
71
- apiVersion: "2024-08-01"
72
- }, $[0] = t0) : t0 = $[0], useClient(t0);
78
+ let $ = c(1), t0;
79
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "2024-08-01" }, $[0] = t0) : t0 = $[0], useClient(t0);
73
80
  }
74
81
  function isUrl(url) {
75
- return url && /^https?:\/\//.test(url);
82
+ return url && /^https?:\/\//.test(url);
76
83
  }
77
84
  function getGraphQLUrl(projectId, dataset) {
78
- return `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
85
+ return `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
79
86
  }
80
87
  function getGroqUrl(projectId, dataset) {
81
- return `https://${projectId}.api.sanity.io/v1/groq/${dataset}`;
88
+ return `https://${projectId}.api.sanity.io/v1/groq/${dataset}`;
82
89
  }
83
90
  function getManageUrl(projectId) {
84
- return `https://manage.sanity.io/projects/${projectId}`;
91
+ return `https://manage.sanity.io/projects/${projectId}`;
85
92
  }
86
93
  const NO_EXPERIMENTAL = [], NO_DATA = [];
87
94
  function ProjectInfo(props) {
88
- const $ = c(37), {
89
- __experimental_before: t0,
90
- data: t1
91
- } = props, __experimental_before = t0 === void 0 ? NO_EXPERIMENTAL : t0, data = t1 === void 0 ? NO_DATA : t1, [studioApps, setStudioApps] = useState(), [graphQLApi, setGraphQLApi] = useState(), versionedClient = useVersionedClient();
92
- let t2;
93
- $[0] !== versionedClient ? (t2 = versionedClient.config(), $[0] = versionedClient, $[1] = t2) : t2 = $[1];
94
- const {
95
- projectId: t3,
96
- dataset: t4
97
- } = t2, projectId = t3 === void 0 ? "unknown" : t3, dataset = t4 === void 0 ? "unknown" : t4;
98
- let t5;
99
- $[2] !== dataset || $[3] !== projectId || $[4] !== versionedClient.observable ? (t5 = () => {
100
- const subscriptions = [];
101
- return subscriptions.push(versionedClient.observable.request({
102
- uri: "/user-applications",
103
- tag: "dashboard.project-info"
104
- }).subscribe({
105
- next: (result) => setStudioApps(result.filter(_temp$2)),
106
- error: (error) => {
107
- console.error("Error while resolving user applications", error), setStudioApps({
108
- error: "Something went wrong while resolving user applications. See console."
109
- });
110
- }
111
- })), subscriptions.push(versionedClient.observable.request({
112
- method: "HEAD",
113
- uri: `/graphql/${dataset}/default`,
114
- tag: "dashboard.project-info.graphql-api"
115
- }).subscribe({
116
- next: () => setGraphQLApi(getGraphQLUrl(projectId, dataset)),
117
- error: (error_0) => {
118
- error_0.statusCode === 404 ? setGraphQLApi(void 0) : (console.error("Error while looking for graphQLApi", error_0), setGraphQLApi({
119
- error: "Something went wrong while looking up graphQLApi. See console."
120
- }));
121
- }
122
- })), () => {
123
- subscriptions.forEach(_temp2$1);
124
- };
125
- }, $[2] = dataset, $[3] = projectId, $[4] = versionedClient.observable, $[5] = t5) : t5 = $[5];
126
- let t6;
127
- $[6] !== dataset || $[7] !== projectId || $[8] !== versionedClient ? (t6 = [dataset, projectId, versionedClient, setGraphQLApi], $[6] = dataset, $[7] = projectId, $[8] = versionedClient, $[9] = t6) : t6 = $[9], useEffect(t5, t6);
128
- let result_0;
129
- if ($[10] !== data || $[11] !== dataset || $[12] !== graphQLApi || $[13] !== projectId || $[14] !== studioApps) {
130
- result_0 = [{
131
- title: "Sanity project",
132
- rows: [{
133
- title: "Project ID",
134
- value: projectId
135
- }, {
136
- title: "Dataset",
137
- value: dataset
138
- }]
139
- }];
140
- const apps = data.filter(_temp3);
141
- (Array.isArray(studioApps) ? studioApps : []).forEach((app_0) => {
142
- apps.push({
143
- title: app_0.title || "Studio",
144
- value: app_0.urlType === "internal" ? `https://${app_0.appHost}.sanity.studio` : app_0.appHost
145
- });
146
- }), apps.length > 0 && (result_0 = result_0.concat([{
147
- title: "Apps",
148
- rows: apps
149
- }])), result_0 = result_0.concat([{
150
- title: "APIs",
151
- rows: [{
152
- title: "GROQ",
153
- value: getGroqUrl(projectId, dataset)
154
- }, {
155
- title: "GraphQL",
156
- value: (typeof graphQLApi == "object" ? "Error" : graphQLApi) ?? "Not deployed"
157
- }]
158
- }], data.filter(_temp4));
159
- const otherStuff = {};
160
- data.forEach((item_1) => {
161
- if (item_1.category && item_1.category !== "apps" && item_1.category !== "apis") {
162
- const group = otherStuff[item_1.category] ?? [];
163
- group.push(item_1), otherStuff[item_1.category] = group;
164
- }
165
- }), Object.keys(otherStuff).forEach((category) => {
166
- result_0.push({
167
- title: category,
168
- rows: otherStuff[category]
169
- });
170
- }), $[10] = data, $[11] = dataset, $[12] = graphQLApi, $[13] = projectId, $[14] = studioApps, $[15] = result_0;
171
- } else
172
- result_0 = $[15];
173
- const assembleTableRows = result_0;
174
- let t7;
175
- $[16] !== __experimental_before ? (t7 = __experimental_before.map(_temp5), $[16] = __experimental_before, $[17] = t7) : t7 = $[17];
176
- const t8 = __experimental_before?.length > 0 ? 4 : 0;
177
- let t9;
178
- $[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = {
179
- width: "100%"
180
- }, $[18] = t9) : t9 = $[18];
181
- let t10;
182
- $[19] !== projectId ? (t10 = getManageUrl(projectId), $[19] = projectId, $[20] = t10) : t10 = $[20];
183
- let t11;
184
- $[21] !== t10 ? (t11 = /* @__PURE__ */ jsx(Button, { style: t9, paddingX: 2, paddingY: 4, mode: "bleed", tone: "primary", text: "Manage project", as: "a", href: t10 }), $[21] = t10, $[22] = t11) : t11 = $[22];
185
- let t12;
186
- $[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(Box, { paddingX: 3, as: "header", children: /* @__PURE__ */ jsx(Heading, { size: 1, as: "h2", id: "project_info_table", children: "Project info" }) }), $[23] = t12) : t12 = $[23];
187
- let t13;
188
- $[24] !== assembleTableRows ? (t13 = assembleTableRows.map(_temp7), $[24] = assembleTableRows, $[25] = t13) : t13 = $[25];
189
- let t14;
190
- $[26] !== t13 ? (t14 = /* @__PURE__ */ jsx(Card, { paddingY: 4, radius: 2, "aria-label": "Project info", children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
191
- t12,
192
- t13
193
- ] }) }), $[26] = t13, $[27] = t14) : t14 = $[27];
194
- let t15;
195
- $[28] !== t11 || $[29] !== t14 ? (t15 = /* @__PURE__ */ jsx(DashboardWidgetContainer, { footer: t11, children: t14 }), $[28] = t11, $[29] = t14, $[30] = t15) : t15 = $[30];
196
- let t16;
197
- $[31] !== t15 || $[32] !== t8 ? (t16 = /* @__PURE__ */ jsx(Box, { height: "fill", marginTop: t8, children: t15 }), $[31] = t15, $[32] = t8, $[33] = t16) : t16 = $[33];
198
- let t17;
199
- return $[34] !== t16 || $[35] !== t7 ? (t17 = /* @__PURE__ */ jsxs(Fragment, { children: [
200
- t7,
201
- t16
202
- ] }), $[34] = t16, $[35] = t7, $[36] = t17) : t17 = $[36], t17;
95
+ let $ = c(37), { __experimental_before: t0, data: t1 } = props, __experimental_before = t0 === void 0 ? NO_EXPERIMENTAL : t0, data = t1 === void 0 ? NO_DATA : t1, [studioApps, setStudioApps] = useState(), [graphQLApi, setGraphQLApi] = useState(), versionedClient = useVersionedClient(), t2;
96
+ $[0] === versionedClient ? t2 = $[1] : (t2 = versionedClient.config(), $[0] = versionedClient, $[1] = t2);
97
+ let { projectId: t3, dataset: t4 } = t2, projectId = t3 === void 0 ? "unknown" : t3, dataset = t4 === void 0 ? "unknown" : t4, t5;
98
+ $[2] !== dataset || $[3] !== projectId || $[4] !== versionedClient.observable ? (t5 = () => {
99
+ let subscriptions = [];
100
+ return subscriptions.push(versionedClient.observable.request({
101
+ uri: "/user-applications",
102
+ tag: "dashboard.project-info"
103
+ }).subscribe({
104
+ next: (result) => setStudioApps(result.filter(_temp$2)),
105
+ error: (error) => {
106
+ console.error("Error while resolving user applications", error), setStudioApps({ error: "Something went wrong while resolving user applications. See console." });
107
+ }
108
+ })), subscriptions.push(versionedClient.observable.request({
109
+ method: "HEAD",
110
+ uri: `/graphql/${dataset}/default`,
111
+ tag: "dashboard.project-info.graphql-api"
112
+ }).subscribe({
113
+ next: () => setGraphQLApi(getGraphQLUrl(projectId, dataset)),
114
+ error: (error_0) => {
115
+ error_0.statusCode === 404 ? setGraphQLApi(void 0) : (console.error("Error while looking for graphQLApi", error_0), setGraphQLApi({ error: "Something went wrong while looking up graphQLApi. See console." }));
116
+ }
117
+ })), () => {
118
+ subscriptions.forEach(_temp2$1);
119
+ };
120
+ }, $[2] = dataset, $[3] = projectId, $[4] = versionedClient.observable, $[5] = t5) : t5 = $[5];
121
+ let t6;
122
+ $[6] !== dataset || $[7] !== projectId || $[8] !== versionedClient ? (t6 = [
123
+ dataset,
124
+ projectId,
125
+ versionedClient,
126
+ setGraphQLApi
127
+ ], $[6] = dataset, $[7] = projectId, $[8] = versionedClient, $[9] = t6) : t6 = $[9], useEffect(t5, t6);
128
+ let result_0;
129
+ if ($[10] !== data || $[11] !== dataset || $[12] !== graphQLApi || $[13] !== projectId || $[14] !== studioApps) {
130
+ result_0 = [{
131
+ title: "Sanity project",
132
+ rows: [{
133
+ title: "Project ID",
134
+ value: projectId
135
+ }, {
136
+ title: "Dataset",
137
+ value: dataset
138
+ }]
139
+ }];
140
+ let apps = data.filter(_temp3);
141
+ (Array.isArray(studioApps) ? studioApps : []).forEach((app_0) => {
142
+ apps.push({
143
+ title: app_0.title || "Studio",
144
+ value: app_0.urlType === "internal" ? `https://${app_0.appHost}.sanity.studio` : app_0.appHost
145
+ });
146
+ }), apps.length > 0 && (result_0 = result_0.concat([{
147
+ title: "Apps",
148
+ rows: apps
149
+ }])), result_0 = result_0.concat([{
150
+ title: "APIs",
151
+ rows: [{
152
+ title: "GROQ",
153
+ value: getGroqUrl(projectId, dataset)
154
+ }, {
155
+ title: "GraphQL",
156
+ value: (typeof graphQLApi == "object" ? "Error" : graphQLApi) ?? "Not deployed"
157
+ }]
158
+ }], data.filter(_temp4));
159
+ let otherStuff = {};
160
+ data.forEach((item_1) => {
161
+ if (item_1.category && item_1.category !== "apps" && item_1.category !== "apis") {
162
+ let group = otherStuff[item_1.category] ?? [];
163
+ group.push(item_1), otherStuff[item_1.category] = group;
164
+ }
165
+ }), Object.keys(otherStuff).forEach((category) => {
166
+ result_0.push({
167
+ title: category,
168
+ rows: otherStuff[category]
169
+ });
170
+ }), $[10] = data, $[11] = dataset, $[12] = graphQLApi, $[13] = projectId, $[14] = studioApps, $[15] = result_0;
171
+ } else result_0 = $[15];
172
+ let assembleTableRows = result_0, t7;
173
+ $[16] === __experimental_before ? t7 = $[17] : (t7 = __experimental_before.map(_temp5), $[16] = __experimental_before, $[17] = t7);
174
+ let t8 = __experimental_before?.length > 0 ? 4 : 0, t9;
175
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t9 = { width: "100%" }, $[18] = t9) : t9 = $[18];
176
+ let t10;
177
+ $[19] === projectId ? t10 = $[20] : (t10 = getManageUrl(projectId), $[19] = projectId, $[20] = t10);
178
+ let t11;
179
+ $[21] === t10 ? t11 = $[22] : (t11 = /* @__PURE__ */ jsx(Button, {
180
+ style: t9,
181
+ paddingX: 2,
182
+ paddingY: 4,
183
+ mode: "bleed",
184
+ tone: "primary",
185
+ text: "Manage project",
186
+ as: "a",
187
+ href: t10
188
+ }), $[21] = t10, $[22] = t11);
189
+ let t12;
190
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(Box, {
191
+ paddingX: 3,
192
+ as: "header",
193
+ children: /* @__PURE__ */ jsx(Heading, {
194
+ size: 1,
195
+ as: "h2",
196
+ id: "project_info_table",
197
+ children: "Project info"
198
+ })
199
+ }), $[23] = t12) : t12 = $[23];
200
+ let t13;
201
+ $[24] === assembleTableRows ? t13 = $[25] : (t13 = assembleTableRows.map(_temp7), $[24] = assembleTableRows, $[25] = t13);
202
+ let t14;
203
+ $[26] === t13 ? t14 = $[27] : (t14 = /* @__PURE__ */ jsx(Card, {
204
+ paddingY: 4,
205
+ radius: 2,
206
+ "aria-label": "Project info",
207
+ children: /* @__PURE__ */ jsxs(Stack, {
208
+ gap: 4,
209
+ children: [t12, t13]
210
+ })
211
+ }), $[26] = t13, $[27] = t14);
212
+ let t15;
213
+ $[28] !== t11 || $[29] !== t14 ? (t15 = /* @__PURE__ */ jsx(DashboardWidgetContainer, {
214
+ footer: t11,
215
+ children: t14
216
+ }), $[28] = t11, $[29] = t14, $[30] = t15) : t15 = $[30];
217
+ let t16;
218
+ $[31] !== t15 || $[32] !== t8 ? (t16 = /* @__PURE__ */ jsx(Box, {
219
+ height: "fill",
220
+ marginTop: t8,
221
+ children: t15
222
+ }), $[31] = t15, $[32] = t8, $[33] = t16) : t16 = $[33];
223
+ let t17;
224
+ return $[34] !== t16 || $[35] !== t7 ? (t17 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t16] }), $[34] = t16, $[35] = t7, $[36] = t17) : t17 = $[36], t17;
203
225
  }
204
226
  function _temp7(item_2) {
205
- return !item_2 || !item_2.rows ? null : /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
206
- /* @__PURE__ */ jsx(Card, { borderBottom: !0, padding: 3, children: /* @__PURE__ */ jsx(Label, { size: 0, muted: !0, children: item_2.title }) }),
207
- /* @__PURE__ */ jsx(Stack, { gap: 4, paddingX: 3, children: item_2.rows.map(_temp6) })
208
- ] }, item_2.title);
227
+ return !item_2 || !item_2.rows ? null : /* @__PURE__ */ jsxs(Stack, {
228
+ gap: 3,
229
+ children: [/* @__PURE__ */ jsx(Card, {
230
+ borderBottom: !0,
231
+ padding: 3,
232
+ children: /* @__PURE__ */ jsx(Label, {
233
+ size: 0,
234
+ muted: !0,
235
+ children: item_2.title
236
+ })
237
+ }), /* @__PURE__ */ jsx(Stack, {
238
+ gap: 4,
239
+ paddingX: 3,
240
+ children: item_2.rows.map(_temp6)
241
+ })]
242
+ }, item_2.title);
209
243
  }
210
244
  function _temp6(row) {
211
- const rowValue = typeof row.value == "object" ? row.value.error : row.value;
212
- return /* @__PURE__ */ jsxs(Grid, { gridTemplateColumns: 2, children: [
213
- /* @__PURE__ */ jsx(Text, { weight: "medium", children: row.title }),
214
- typeof row.value == "object" && /* @__PURE__ */ jsx(Text, { size: 1, children: row.value?.error }),
215
- typeof row.value == "string" && /* @__PURE__ */ jsx(Fragment, { children: isUrl(row.value) ? /* @__PURE__ */ jsx(Text, { size: 1, style: {
216
- wordBreak: "break-word"
217
- }, children: /* @__PURE__ */ jsx("a", { href: row.value, children: row.value }) }) : /* @__PURE__ */ jsx(Code, { size: 1, style: {
218
- wordBreak: "break-word"
219
- }, children: row.value }) })
220
- ] }, `${rowValue ?? ""}-${row.title}`);
245
+ let rowValue = typeof row.value == "object" ? row.value.error : row.value;
246
+ return /* @__PURE__ */ jsxs(Grid, {
247
+ gridTemplateColumns: 2,
248
+ children: [
249
+ /* @__PURE__ */ jsx(Text, {
250
+ weight: "medium",
251
+ children: row.title
252
+ }),
253
+ typeof row.value == "object" && /* @__PURE__ */ jsx(Text, {
254
+ size: 1,
255
+ children: row.value?.error
256
+ }),
257
+ typeof row.value == "string" && /* @__PURE__ */ jsx(Fragment, { children: isUrl(row.value) ? /* @__PURE__ */ jsx(Text, {
258
+ size: 1,
259
+ style: { wordBreak: "break-word" },
260
+ children: /* @__PURE__ */ jsx("a", {
261
+ href: row.value,
262
+ children: row.value
263
+ })
264
+ }) : /* @__PURE__ */ jsx(Code, {
265
+ size: 1,
266
+ style: { wordBreak: "break-word" },
267
+ children: row.value
268
+ }) })
269
+ ]
270
+ }, `${rowValue ?? ""}-${row.title}`);
221
271
  }
222
272
  function _temp5(widgetConfig, idx) {
223
- return /* @__PURE__ */ jsx(WidgetContainer, { ...widgetConfig }, idx);
273
+ return /* @__PURE__ */ jsx(WidgetContainer, { ...widgetConfig }, idx);
224
274
  }
225
275
  function _temp4(item_0) {
226
- return item_0.category === "apis";
276
+ return item_0.category === "apis";
227
277
  }
228
278
  function _temp3(item) {
229
- return item.category === "apps";
279
+ return item.category === "apps";
230
280
  }
231
281
  function _temp2$1(s) {
232
- return s.unsubscribe();
282
+ return s.unsubscribe();
233
283
  }
234
284
  function _temp$2(app) {
235
- return app.type === "studio";
285
+ return app.type === "studio";
236
286
  }
237
287
  function projectInfoWidget(config) {
238
- return {
239
- name: "project-info",
240
- component: ProjectInfo,
241
- layout: config?.layout ?? {
242
- width: "medium"
243
- }
244
- };
245
- }
246
- const Root$2 = /* @__PURE__ */ styled(Flex).withConfig({
247
- displayName: "Root",
248
- componentId: "sc-63c5lb-0"
249
- })(["height:", ";box-sizing:content-box;"], rem(33));
288
+ return {
289
+ name: "project-info",
290
+ component: ProjectInfo,
291
+ layout: config?.layout ?? { width: "medium" }
292
+ };
293
+ }
294
+ const Root$2 = styled(Flex).withConfig({
295
+ displayName: "Root",
296
+ componentId: "sc-sdrwc6-0"
297
+ })`height:${rem(33)};box-sizing:content-box;`;
250
298
  function ProjectUser(t0) {
251
- const $ = c(18), {
252
- user,
253
- isRobot,
254
- roles
255
- } = t0;
256
- let t1;
257
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
258
- style: "narrow"
259
- }, $[0] = t1) : t1 = $[0];
260
- const listFormat = useListFormat(t1);
261
- let t2;
262
- $[1] !== isRobot || $[2] !== user ? (t2 = /* @__PURE__ */ jsx(Box, { flex: "none", children: isRobot ? /* @__PURE__ */ jsx(Text, { size: 2, children: /* @__PURE__ */ jsx(RobotIcon, {}) }) : /* @__PURE__ */ jsx(UserAvatar, { user }) }), $[1] = isRobot, $[2] = user, $[3] = t2) : t2 = $[3];
263
- let t3;
264
- $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = {
265
- color: "inherit"
266
- }, $[4] = t3) : t3 = $[4];
267
- let t4;
268
- $[5] !== user.displayName ? (t4 = /* @__PURE__ */ jsx(Text, { size: 1, style: t3, textOverflow: "ellipsis", weight: "medium", children: user.displayName }), $[5] = user.displayName, $[6] = t4) : t4 = $[6];
269
- let t5;
270
- $[7] !== listFormat || $[8] !== roles ? (t5 = listFormat.format(roles), $[7] = listFormat, $[8] = roles, $[9] = t5) : t5 = $[9];
271
- let t6;
272
- $[10] !== t5 ? (t6 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, textOverflow: "ellipsis", children: t5 }), $[10] = t5, $[11] = t6) : t6 = $[11];
273
- let t7;
274
- $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxs(Stack, { flex: 1, gap: 2, children: [
275
- t4,
276
- t6
277
- ] }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
278
- let t8;
279
- return $[15] !== t2 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsx(Root$2, { align: "center", children: /* @__PURE__ */ jsxs(Flex, { align: "center", flex: 1, gap: 2, children: [
280
- t2,
281
- t7
282
- ] }) }), $[15] = t2, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
299
+ let $ = c(18), { user, isRobot, roles } = t0, t1;
300
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { style: "narrow" }, $[0] = t1) : t1 = $[0];
301
+ let listFormat = useListFormat(t1), t2;
302
+ $[1] !== isRobot || $[2] !== user ? (t2 = /* @__PURE__ */ jsx(Box, {
303
+ flex: "none",
304
+ children: isRobot ? /* @__PURE__ */ jsx(Text, {
305
+ size: 2,
306
+ children: /* @__PURE__ */ jsx(RobotIcon, {})
307
+ }) : /* @__PURE__ */ jsx(UserAvatar, { user })
308
+ }), $[1] = isRobot, $[2] = user, $[3] = t2) : t2 = $[3];
309
+ let t3;
310
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = { color: "inherit" }, $[4] = t3) : t3 = $[4];
311
+ let t4;
312
+ $[5] === user.displayName ? t4 = $[6] : (t4 = /* @__PURE__ */ jsx(Text, {
313
+ size: 1,
314
+ style: t3,
315
+ textOverflow: "ellipsis",
316
+ weight: "medium",
317
+ children: user.displayName
318
+ }), $[5] = user.displayName, $[6] = t4);
319
+ let t5;
320
+ $[7] !== listFormat || $[8] !== roles ? (t5 = listFormat.format(roles), $[7] = listFormat, $[8] = roles, $[9] = t5) : t5 = $[9];
321
+ let t6;
322
+ $[10] === t5 ? t6 = $[11] : (t6 = /* @__PURE__ */ jsx(Text, {
323
+ muted: !0,
324
+ size: 1,
325
+ textOverflow: "ellipsis",
326
+ children: t5
327
+ }), $[10] = t5, $[11] = t6);
328
+ let t7;
329
+ $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxs(Stack, {
330
+ flex: 1,
331
+ gap: 2,
332
+ children: [t4, t6]
333
+ }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
334
+ let t8;
335
+ return $[15] !== t2 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsx(Root$2, {
336
+ align: "center",
337
+ children: /* @__PURE__ */ jsxs(Flex, {
338
+ align: "center",
339
+ flex: 1,
340
+ gap: 2,
341
+ children: [t2, t7]
342
+ })
343
+ }), $[15] = t2, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
283
344
  }
284
345
  function getInviteUrl(projectId) {
285
- return `https://manage.sanity.io/projects/${projectId}/members`;
346
+ return `https://manage.sanity.io/projects/${projectId}/members`;
286
347
  }
287
348
  function ProjectUsers() {
288
- const $ = c(28), [project, setProject] = useState(), [users, setUsers] = useState(), [error, setError] = useState(), userStore = useUserStore(), versionedClient = useVersionedClient();
289
- let t0;
290
- $[0] !== userStore || $[1] !== versionedClient ? (t0 = () => {
291
- const {
292
- projectId
293
- } = versionedClient.config(), subscription = versionedClient.observable.request({
294
- uri: `/projects/${projectId}`,
295
- tag: "dashboard.project-users"
296
- }).pipe(switchMap((_project) => from(userStore.getUsers(_project.members.map(_temp$1))).pipe(map((_users) => ({
297
- project: _project,
298
- users: _users
299
- }))))).subscribe({
300
- next: (t12) => {
301
- const {
302
- users: _users_0,
303
- project: _project_0
304
- } = t12;
305
- setProject(_project_0), setUsers((Array.isArray(_users_0) ? _users_0 : [_users_0]).sort((userA, userB) => sortUsersByRobotStatus(userA, userB, _project_0)));
306
- },
307
- error: (e) => setError(e)
308
- });
309
- return () => subscription.unsubscribe();
310
- }, $[0] = userStore, $[1] = versionedClient, $[2] = t0) : t0 = $[2];
311
- const fetchData = t0;
312
- let t1, t2;
313
- $[3] !== fetchData ? (t1 = () => fetchData(), t2 = [fetchData], $[3] = fetchData, $[4] = t1, $[5] = t2) : (t1 = $[4], t2 = $[5]), useEffect(t1, t2);
314
- let t3;
315
- $[6] !== fetchData ? (t3 = () => fetchData(), $[6] = fetchData, $[7] = t3) : t3 = $[7];
316
- const handleRetryFetch = t3, isLoading = !users || !project;
317
- if (error) {
318
- let t42;
319
- $[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t42 = /* @__PURE__ */ jsx(Text, { children: "Something went wrong while fetching data." }), $[8] = t42) : t42 = $[8];
320
- let t52;
321
- return $[9] !== handleRetryFetch ? (t52 = /* @__PURE__ */ jsx(DashboardWidgetContainer, { header: "Project users", children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
322
- t42,
323
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Button, { mode: "ghost", text: "Retry", title: "Retry users fetch", onClick: handleRetryFetch }) })
324
- ] }) }) }), $[9] = handleRetryFetch, $[10] = t52) : t52 = $[10], t52;
325
- }
326
- let t4;
327
- $[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = {
328
- width: "100%"
329
- }, $[11] = t4) : t4 = $[11];
330
- let t5;
331
- $[12] !== isLoading || $[13] !== project ? (t5 = isLoading ? void 0 : getInviteUrl(project.id), $[12] = isLoading, $[13] = project, $[14] = t5) : t5 = $[14];
332
- let t6;
333
- $[15] !== isLoading || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsx(Button, { style: t4, paddingX: 2, paddingY: 4, mode: "bleed", tone: "primary", text: "Manage members", as: "a", loading: isLoading, href: t5 }), $[15] = isLoading, $[16] = t5, $[17] = t6) : t6 = $[17];
334
- let t7;
335
- $[18] !== isLoading ? (t7 = isLoading && /* @__PURE__ */ jsx(Box, { paddingY: 5, paddingX: 2, children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
336
- /* @__PURE__ */ jsx(Text, { align: "center", muted: !0, size: 1, children: /* @__PURE__ */ jsx(Spinner, {}) }),
337
- /* @__PURE__ */ jsx(Text, { align: "center", size: 1, muted: !0, children: "Loading items\u2026" })
338
- ] }) }), $[18] = isLoading, $[19] = t7) : t7 = $[19];
339
- let t8;
340
- $[20] !== isLoading || $[21] !== project || $[22] !== users ? (t8 = !isLoading && /* @__PURE__ */ jsx(Stack, { gap: 3, padding: 3, children: users?.map((user) => {
341
- const membership = project.members.find((member) => member.id === user.id);
342
- return /* @__PURE__ */ jsx(ProjectUser, { user, isRobot: membership?.isRobot ?? !1, roles: membership?.roles.map(_temp2) || [] }, user.id);
343
- }) }), $[20] = isLoading, $[21] = project, $[22] = users, $[23] = t8) : t8 = $[23];
344
- let t9;
345
- return $[24] !== t6 || $[25] !== t7 || $[26] !== t8 ? (t9 = /* @__PURE__ */ jsxs(DashboardWidgetContainer, { header: "Project users", footer: t6, children: [
346
- t7,
347
- t8
348
- ] }), $[24] = t6, $[25] = t7, $[26] = t8, $[27] = t9) : t9 = $[27], t9;
349
+ let $ = c(28), [project, setProject] = useState(), [users, setUsers] = useState(), [error, setError] = useState(), userStore = useUserStore(), versionedClient = useVersionedClient(), t0;
350
+ $[0] !== userStore || $[1] !== versionedClient ? (t0 = () => {
351
+ let { projectId } = versionedClient.config(), subscription = versionedClient.observable.request({
352
+ uri: `/projects/${projectId}`,
353
+ tag: "dashboard.project-users"
354
+ }).pipe(switchMap((_project) => from(userStore.getUsers(_project.members.map(_temp$1))).pipe(map((_users) => ({
355
+ project: _project,
356
+ users: _users
357
+ }))))).subscribe({
358
+ next: (t1) => {
359
+ let { users: _users_0, project: _project_0 } = t1;
360
+ setProject(_project_0), setUsers((Array.isArray(_users_0) ? _users_0 : [_users_0]).sort((userA, userB) => sortUsersByRobotStatus(userA, userB, _project_0)));
361
+ },
362
+ error: (e) => setError(e)
363
+ });
364
+ return () => subscription.unsubscribe();
365
+ }, $[0] = userStore, $[1] = versionedClient, $[2] = t0) : t0 = $[2];
366
+ let fetchData = t0, t1, t2;
367
+ $[3] === fetchData ? (t1 = $[4], t2 = $[5]) : (t1 = () => fetchData(), t2 = [fetchData], $[3] = fetchData, $[4] = t1, $[5] = t2), useEffect(t1, t2);
368
+ let t3;
369
+ $[6] === fetchData ? t3 = $[7] : (t3 = () => fetchData(), $[6] = fetchData, $[7] = t3);
370
+ let handleRetryFetch = t3, isLoading = !users || !project;
371
+ if (error) {
372
+ let t4;
373
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsx(Text, { children: "Something went wrong while fetching data." }), $[8] = t4) : t4 = $[8];
374
+ let t5;
375
+ return $[9] === handleRetryFetch ? t5 = $[10] : (t5 = /* @__PURE__ */ jsx(DashboardWidgetContainer, {
376
+ header: "Project users",
377
+ children: /* @__PURE__ */ jsx(Box, {
378
+ padding: 4,
379
+ children: /* @__PURE__ */ jsxs(Stack, {
380
+ gap: 3,
381
+ children: [t4, /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Button, {
382
+ mode: "ghost",
383
+ text: "Retry",
384
+ title: "Retry users fetch",
385
+ onClick: handleRetryFetch
386
+ }) })]
387
+ })
388
+ })
389
+ }), $[9] = handleRetryFetch, $[10] = t5), t5;
390
+ }
391
+ let t4;
392
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = { width: "100%" }, $[11] = t4) : t4 = $[11];
393
+ let t5;
394
+ $[12] !== isLoading || $[13] !== project ? (t5 = isLoading ? void 0 : getInviteUrl(project.id), $[12] = isLoading, $[13] = project, $[14] = t5) : t5 = $[14];
395
+ let t6;
396
+ $[15] !== isLoading || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsx(Button, {
397
+ style: t4,
398
+ paddingX: 2,
399
+ paddingY: 4,
400
+ mode: "bleed",
401
+ tone: "primary",
402
+ text: "Manage members",
403
+ as: "a",
404
+ loading: isLoading,
405
+ href: t5
406
+ }), $[15] = isLoading, $[16] = t5, $[17] = t6) : t6 = $[17];
407
+ let t7;
408
+ $[18] === isLoading ? t7 = $[19] : (t7 = isLoading && /* @__PURE__ */ jsx(Box, {
409
+ paddingY: 5,
410
+ paddingX: 2,
411
+ children: /* @__PURE__ */ jsxs(Stack, {
412
+ gap: 4,
413
+ children: [/* @__PURE__ */ jsx(Text, {
414
+ align: "center",
415
+ muted: !0,
416
+ size: 1,
417
+ children: /* @__PURE__ */ jsx(Spinner, {})
418
+ }), /* @__PURE__ */ jsx(Text, {
419
+ align: "center",
420
+ size: 1,
421
+ muted: !0,
422
+ children: "Loading items…"
423
+ })]
424
+ })
425
+ }), $[18] = isLoading, $[19] = t7);
426
+ let t8;
427
+ $[20] !== isLoading || $[21] !== project || $[22] !== users ? (t8 = !isLoading && /* @__PURE__ */ jsx(Stack, {
428
+ gap: 3,
429
+ padding: 3,
430
+ children: users?.map((user) => {
431
+ let membership = project.members.find((member) => member.id === user.id);
432
+ return /* @__PURE__ */ jsx(ProjectUser, {
433
+ user,
434
+ isRobot: membership?.isRobot ?? !1,
435
+ roles: membership?.roles.map(_temp2) || []
436
+ }, user.id);
437
+ })
438
+ }), $[20] = isLoading, $[21] = project, $[22] = users, $[23] = t8) : t8 = $[23];
439
+ let t9;
440
+ return $[24] !== t6 || $[25] !== t7 || $[26] !== t8 ? (t9 = /* @__PURE__ */ jsxs(DashboardWidgetContainer, {
441
+ header: "Project users",
442
+ footer: t6,
443
+ children: [t7, t8]
444
+ }), $[24] = t6, $[25] = t7, $[26] = t8, $[27] = t9) : t9 = $[27], t9;
349
445
  }
350
446
  function _temp2(role) {
351
- return role.title;
447
+ return role.title;
352
448
  }
353
449
  function _temp$1(mem) {
354
- return mem.id;
450
+ return mem.id;
355
451
  }
356
452
  function sortUsersByRobotStatus(userA, userB, project) {
357
- const {
358
- members
359
- } = project, membershipA = members.find((member) => member.id === userA?.id), membershipB = members.find((member) => member.id === userB?.id);
360
- return membershipA?.isRobot === membershipB?.isRobot ? (membershipA?.createdAt || "") > (membershipB?.createdAt || "") ? 1 : -1 : membershipA?.isRobot ? 1 : -1;
453
+ let { members } = project, membershipA = members.find((member) => member.id === userA?.id), membershipB = members.find((member) => member.id === userB?.id);
454
+ return membershipA?.isRobot === membershipB?.isRobot ? (membershipA?.createdAt || "") > (membershipB?.createdAt || "") ? 1 : -1 : membershipA?.isRobot ? 1 : -1;
361
455
  }
362
456
  function projectUsersWidget(config) {
363
- return {
364
- name: "project-users",
365
- component: ProjectUsers,
366
- layout: config?.layout
367
- };
457
+ return {
458
+ name: "project-users",
459
+ component: ProjectUsers,
460
+ layout: config?.layout
461
+ };
368
462
  }
369
463
  const tutorialsProjectConfig = {
370
- projectId: "3do82whm",
371
- dataset: "next"
464
+ projectId: "3do82whm",
465
+ dataset: "next"
372
466
  };
373
467
  function useDataAdapter() {
374
- const $ = c(5), versionedClient = useVersionedClient();
375
- let t0;
376
- $[0] !== versionedClient ? (t0 = (templateRepoId) => {
377
- const uri = templateRepoId ? `/addons/dashboard?templateRepoId=${templateRepoId}` : "/addons/dashboard";
378
- return versionedClient.observable.request({
379
- uri,
380
- tag: "dashboard.sanity-tutorials",
381
- withCredentials: !1
382
- });
383
- }, $[0] = versionedClient, $[1] = t0) : t0 = $[1];
384
- let t1;
385
- $[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = createImageUrlBuilder(tutorialsProjectConfig), $[2] = t1) : t1 = $[2];
386
- let t2;
387
- return $[3] !== t0 ? (t2 = {
388
- getFeed: t0,
389
- urlBuilder: t1
390
- }, $[3] = t0, $[4] = t2) : t2 = $[4], t2;
391
- }
392
- const PlayIconBox = /* @__PURE__ */ styled(Box).withConfig({
393
- displayName: "PlayIconBox",
394
- componentId: "sc-15gyucb-0"
395
- })(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);&:before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:2.75em;height:2.75em;border-radius:50%;background:", ";opacity:0.75;}"], ({
396
- theme
397
- }) => getTheme_v2(theme).color.bg), Root$1 = /* @__PURE__ */ styled(Flex).withConfig({
398
- displayName: "Root",
399
- componentId: "sc-15gyucb-1"
400
- })(["&:hover{", "{&:before{opacity:1;}}}"], PlayIconBox), PosterCard = /* @__PURE__ */ styled(Card).withConfig({
401
- displayName: "PosterCard",
402
- componentId: "sc-15gyucb-2"
403
- })(["width:100%;padding-bottom:calc(9 / 16 * 100%);position:relative;"]), Poster = /* @__PURE__ */ styled.img.withConfig({
404
- displayName: "Poster",
405
- componentId: "sc-15gyucb-3"
406
- })(["position:absolute;top:0;left:0;height:100%;width:100%;object-fit:cover;display:block;&:not([src]){display:none;}"]);
468
+ let $ = c(5), versionedClient = useVersionedClient(), t0;
469
+ $[0] === versionedClient ? t0 = $[1] : (t0 = (templateRepoId) => {
470
+ let uri = templateRepoId ? `/addons/dashboard?templateRepoId=${templateRepoId}` : "/addons/dashboard";
471
+ return versionedClient.observable.request({
472
+ uri,
473
+ tag: "dashboard.sanity-tutorials",
474
+ withCredentials: !1
475
+ });
476
+ }, $[0] = versionedClient, $[1] = t0);
477
+ let t1;
478
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = createImageUrlBuilder(tutorialsProjectConfig), $[2] = t1) : t1 = $[2];
479
+ let t2;
480
+ return $[3] === t0 ? t2 = $[4] : (t2 = {
481
+ getFeed: t0,
482
+ urlBuilder: t1
483
+ }, $[3] = t0, $[4] = t2), t2;
484
+ }
485
+ const PlayIconBox = styled(Box).withConfig({
486
+ displayName: "PlayIconBox",
487
+ componentId: "sc-ptigy3-0"
488
+ })`position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);&:before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:2.75em;height:2.75em;border-radius:50%;background:${({ theme }) => getTheme_v2(theme).color.bg};opacity:0.75;}`, Root$1 = styled(Flex).withConfig({
489
+ displayName: "Root",
490
+ componentId: "sc-ptigy3-1"
491
+ })`&:hover{${PlayIconBox}{&:before{opacity:1;}}}`, PosterCard = styled(Card).withConfig({
492
+ displayName: "PosterCard",
493
+ componentId: "sc-ptigy3-2"
494
+ })`width:100%;padding-bottom:calc(9 / 16 * 100%);position:relative;`, Poster = styled.img.withConfig({
495
+ displayName: "Poster",
496
+ componentId: "sc-ptigy3-3"
497
+ })`position:absolute;top:0;left:0;height:100%;width:100%;object-fit:cover;display:block;&:not([src]){display:none;}`;
407
498
  function Tutorial(props) {
408
- const $ = c(24), {
409
- title,
410
- posterURL,
411
- showPlayIcon,
412
- href,
413
- presenterName,
414
- presenterSubtitle
415
- } = props;
416
- let t0;
417
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = {
418
- position: "relative"
419
- }, $[0] = t0) : t0 = $[0];
420
- let t1;
421
- $[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
422
- height: "100%"
423
- }, $[1] = t1) : t1 = $[1];
424
- let t2;
425
- $[2] !== posterURL || $[3] !== showPlayIcon ? (t2 = posterURL && /* @__PURE__ */ jsxs(PosterCard, { marginBottom: 1, children: [
426
- /* @__PURE__ */ jsx(Poster, { src: posterURL }),
427
- showPlayIcon && /* @__PURE__ */ jsx(PlayIconBox, { display: "flex", children: /* @__PURE__ */ jsx(Text, { align: "center", children: /* @__PURE__ */ jsx(PlayIcon, {}) }) })
428
- ] }), $[2] = posterURL, $[3] = showPlayIcon, $[4] = t2) : t2 = $[4];
429
- let t3;
430
- $[5] !== title ? (t3 = /* @__PURE__ */ jsx(Heading, { as: "h3", size: 1, children: title }), $[5] = title, $[6] = t3) : t3 = $[6];
431
- let t4;
432
- $[7] !== presenterName ? (t4 = /* @__PURE__ */ jsx(Text, { size: 1, children: presenterName }), $[7] = presenterName, $[8] = t4) : t4 = $[8];
433
- let t5;
434
- $[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = {
435
- opacity: 0.7
436
- }, $[9] = t5) : t5 = $[9];
437
- let t6;
438
- $[10] !== presenterSubtitle ? (t6 = /* @__PURE__ */ jsx(Text, { size: 0, style: t5, children: presenterSubtitle }), $[10] = presenterSubtitle, $[11] = t6) : t6 = $[11];
439
- let t7;
440
- $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { marginTop: 4, children: /* @__PURE__ */ jsxs(Stack, { gap: 2, flex: 1, children: [
441
- t4,
442
- t6
443
- ] }) }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
444
- let t8;
445
- $[15] !== t3 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsxs(Flex, { direction: "column", justify: "space-between", paddingY: 2, flex: 1, children: [
446
- t3,
447
- t7
448
- ] }), $[15] = t3, $[16] = t7, $[17] = t8) : t8 = $[17];
449
- let t9;
450
- $[18] !== t2 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Flex, { direction: "column", style: t1, children: [
451
- t2,
452
- t8
453
- ] }), $[18] = t2, $[19] = t8, $[20] = t9) : t9 = $[20];
454
- let t10;
455
- return $[21] !== href || $[22] !== t9 ? (t10 = /* @__PURE__ */ jsx(Root$1, { flex: 1, children: /* @__PURE__ */ jsx(Card, { sizing: "border", flex: 1, padding: 2, radius: 2, as: "a", href, target: "_blank", rel: "noopener noreferrer", style: t0, children: t9 }) }), $[21] = href, $[22] = t9, $[23] = t10) : t10 = $[23], t10;
499
+ let $ = c(24), { title, posterURL, showPlayIcon, href, presenterName, presenterSubtitle } = props, t0;
500
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { position: "relative" }, $[0] = t0) : t0 = $[0];
501
+ let t1;
502
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { height: "100%" }, $[1] = t1) : t1 = $[1];
503
+ let t2;
504
+ $[2] !== posterURL || $[3] !== showPlayIcon ? (t2 = posterURL && /* @__PURE__ */ jsxs(PosterCard, {
505
+ marginBottom: 1,
506
+ children: [/* @__PURE__ */ jsx(Poster, { src: posterURL }), showPlayIcon && /* @__PURE__ */ jsx(PlayIconBox, {
507
+ display: "flex",
508
+ children: /* @__PURE__ */ jsx(Text, {
509
+ align: "center",
510
+ children: /* @__PURE__ */ jsx(PlayIcon, {})
511
+ })
512
+ })]
513
+ }), $[2] = posterURL, $[3] = showPlayIcon, $[4] = t2) : t2 = $[4];
514
+ let t3;
515
+ $[5] === title ? t3 = $[6] : (t3 = /* @__PURE__ */ jsx(Heading, {
516
+ as: "h3",
517
+ size: 1,
518
+ children: title
519
+ }), $[5] = title, $[6] = t3);
520
+ let t4;
521
+ $[7] === presenterName ? t4 = $[8] : (t4 = /* @__PURE__ */ jsx(Text, {
522
+ size: 1,
523
+ children: presenterName
524
+ }), $[7] = presenterName, $[8] = t4);
525
+ let t5;
526
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = { opacity: .7 }, $[9] = t5) : t5 = $[9];
527
+ let t6;
528
+ $[10] === presenterSubtitle ? t6 = $[11] : (t6 = /* @__PURE__ */ jsx(Text, {
529
+ size: 0,
530
+ style: t5,
531
+ children: presenterSubtitle
532
+ }), $[10] = presenterSubtitle, $[11] = t6);
533
+ let t7;
534
+ $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, {
535
+ marginTop: 4,
536
+ children: /* @__PURE__ */ jsxs(Stack, {
537
+ gap: 2,
538
+ flex: 1,
539
+ children: [t4, t6]
540
+ })
541
+ }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
542
+ let t8;
543
+ $[15] !== t3 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsxs(Flex, {
544
+ direction: "column",
545
+ justify: "space-between",
546
+ paddingY: 2,
547
+ flex: 1,
548
+ children: [t3, t7]
549
+ }), $[15] = t3, $[16] = t7, $[17] = t8) : t8 = $[17];
550
+ let t9;
551
+ $[18] !== t2 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Flex, {
552
+ direction: "column",
553
+ style: t1,
554
+ children: [t2, t8]
555
+ }), $[18] = t2, $[19] = t8, $[20] = t9) : t9 = $[20];
556
+ let t10;
557
+ return $[21] !== href || $[22] !== t9 ? (t10 = /* @__PURE__ */ jsx(Root$1, {
558
+ flex: 1,
559
+ children: /* @__PURE__ */ jsx(Card, {
560
+ sizing: "border",
561
+ flex: 1,
562
+ padding: 2,
563
+ radius: 2,
564
+ as: "a",
565
+ href,
566
+ target: "_blank",
567
+ rel: "noopener noreferrer",
568
+ style: t0,
569
+ children: t9
570
+ })
571
+ }), $[21] = href, $[22] = t9, $[23] = t10) : t10 = $[23], t10;
456
572
  }
457
573
  function createUrl(slug, type) {
458
- return type === "tutorial" ? `https://www.sanity.io/docs/tutorials/${slug.current}` : type === "guide" ? `https://www.sanity.io/docs/guides/${slug.current}` : !1;
574
+ return type === "tutorial" ? `https://www.sanity.io/docs/tutorials/${slug.current}` : type === "guide" ? `https://www.sanity.io/docs/guides/${slug.current}` : !1;
459
575
  }
460
576
  function SanityTutorials(props) {
461
- const $ = c(10), {
462
- templateRepoId
463
- } = props;
464
- let t0;
465
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
466
- const [feedItems, setFeedItems] = useState(t0), {
467
- getFeed,
468
- urlBuilder
469
- } = useDataAdapter();
470
- let t1, t2;
471
- $[1] !== getFeed || $[2] !== templateRepoId ? (t1 = () => {
472
- const subscription = getFeed(templateRepoId).subscribe((response) => {
473
- setFeedItems(response.items);
474
- });
475
- return () => {
476
- subscription.unsubscribe();
477
- };
478
- }, t2 = [setFeedItems, getFeed, templateRepoId], $[1] = getFeed, $[2] = templateRepoId, $[3] = t1, $[4] = t2) : (t1 = $[3], t2 = $[4]), useEffect(t1, t2);
479
- let t3;
480
- $[5] !== feedItems || $[6] !== urlBuilder ? (t3 = feedItems?.map((feedItem, index) => {
481
- if (!feedItem.title || !feedItem.guideOrTutorial && !feedItem.externalLink)
482
- return null;
483
- const presenter = feedItem.presenter || feedItem.guideOrTutorial?.presenter || {}, subtitle = feedItem.category, {
484
- guideOrTutorial: t42
485
- } = feedItem, guideOrTutorial = t42 === void 0 ? {} : t42, href = (guideOrTutorial.slug ? createUrl(guideOrTutorial.slug, guideOrTutorial._type) : feedItem.externalLink) || feedItem.externalLink;
486
- return /* @__PURE__ */ jsx(Flex, { as: "li", paddingRight: index < feedItems?.length - 1 ? 1 : 3, paddingLeft: index === 0 ? 3 : 0, align: "stretch", style: {
487
- minWidth: 272,
488
- width: "30%"
489
- }, children: /* @__PURE__ */ jsx(Tutorial, { title: feedItem.title, href: href ?? "", presenterName: presenter.name, presenterSubtitle: subtitle, showPlayIcon: feedItem.hasVideo, posterURL: feedItem.poster ? urlBuilder.image(feedItem.poster).height(360).url() : void 0 }) }, feedItem._id);
490
- }), $[5] = feedItems, $[6] = urlBuilder, $[7] = t3) : t3 = $[7];
491
- let t4;
492
- return $[8] !== t3 ? (t4 = /* @__PURE__ */ jsx(DashboardWidgetContainer, { header: "Learn about Sanity", children: /* @__PURE__ */ jsx(Flex, { as: "ul", overflow: "auto", align: "stretch", paddingY: 2, children: t3 }) }), $[8] = t3, $[9] = t4) : t4 = $[9], t4;
577
+ let $ = c(10), { templateRepoId } = props, t0;
578
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
579
+ let [feedItems, setFeedItems] = useState(t0), { getFeed, urlBuilder } = useDataAdapter(), t1, t2;
580
+ $[1] !== getFeed || $[2] !== templateRepoId ? (t1 = () => {
581
+ let subscription = getFeed(templateRepoId).subscribe((response) => {
582
+ setFeedItems(response.items);
583
+ });
584
+ return () => {
585
+ subscription.unsubscribe();
586
+ };
587
+ }, t2 = [
588
+ setFeedItems,
589
+ getFeed,
590
+ templateRepoId
591
+ ], $[1] = getFeed, $[2] = templateRepoId, $[3] = t1, $[4] = t2) : (t1 = $[3], t2 = $[4]), useEffect(t1, t2);
592
+ let t3;
593
+ $[5] !== feedItems || $[6] !== urlBuilder ? (t3 = feedItems?.map((feedItem, index) => {
594
+ if (!feedItem.title || !feedItem.guideOrTutorial && !feedItem.externalLink) return null;
595
+ let presenter = feedItem.presenter || feedItem.guideOrTutorial?.presenter || {}, subtitle = feedItem.category, { guideOrTutorial: t4 } = feedItem, guideOrTutorial = t4 === void 0 ? {} : t4, href = (guideOrTutorial.slug ? createUrl(guideOrTutorial.slug, guideOrTutorial._type) : feedItem.externalLink) || feedItem.externalLink;
596
+ return /* @__PURE__ */ jsx(Flex, {
597
+ as: "li",
598
+ paddingRight: index < feedItems?.length - 1 ? 1 : 3,
599
+ paddingLeft: index === 0 ? 3 : 0,
600
+ align: "stretch",
601
+ style: {
602
+ minWidth: 272,
603
+ width: "30%"
604
+ },
605
+ children: /* @__PURE__ */ jsx(Tutorial, {
606
+ title: feedItem.title,
607
+ href: href ?? "",
608
+ presenterName: presenter.name,
609
+ presenterSubtitle: subtitle,
610
+ showPlayIcon: feedItem.hasVideo,
611
+ posterURL: feedItem.poster ? urlBuilder.image(feedItem.poster).height(360).url() : void 0
612
+ })
613
+ }, feedItem._id);
614
+ }), $[5] = feedItems, $[6] = urlBuilder, $[7] = t3) : t3 = $[7];
615
+ let t4;
616
+ return $[8] === t3 ? t4 = $[9] : (t4 = /* @__PURE__ */ jsx(DashboardWidgetContainer, {
617
+ header: "Learn about Sanity",
618
+ children: /* @__PURE__ */ jsx(Flex, {
619
+ as: "ul",
620
+ overflow: "auto",
621
+ align: "stretch",
622
+ paddingY: 2,
623
+ children: t3
624
+ })
625
+ }), $[8] = t3, $[9] = t4), t4;
493
626
  }
494
627
  function sanityTutorialsWidget(config) {
495
- return {
496
- name: "sanity-tutorials",
497
- component: SanityTutorials,
498
- layout: config?.layout ?? {
499
- width: "full"
500
- }
501
- };
628
+ return {
629
+ name: "sanity-tutorials",
630
+ component: SanityTutorials,
631
+ layout: config?.layout ?? { width: "full" }
632
+ };
502
633
  }
503
634
  function DashboardLayout(t0) {
504
- const $ = c(3), {
505
- children
506
- } = t0;
507
- let t1;
508
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
509
- height: "100%",
510
- overflowY: "auto"
511
- }, $[0] = t1) : t1 = $[0];
512
- let t2;
513
- return $[1] !== children ? (t2 = /* @__PURE__ */ jsx(Container, { width: 4, padding: 4, sizing: "border", style: t1, children }), $[1] = children, $[2] = t2) : t2 = $[2], t2;
635
+ let $ = c(3), { children } = t0, t1;
636
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = {
637
+ height: "100%",
638
+ overflowY: "auto"
639
+ }, $[0] = t1) : t1 = $[0];
640
+ let t2;
641
+ return $[1] === children ? t2 = $[2] : (t2 = /* @__PURE__ */ jsx(Container, {
642
+ width: 4,
643
+ padding: 4,
644
+ sizing: "border",
645
+ style: t1,
646
+ children
647
+ }), $[1] = children, $[2] = t2), t2;
514
648
  }
515
649
  const media = {
516
- small: (...args) => css(["@media (min-width:", "px){", "}"], ({
517
- theme
518
- }) => getTheme_v2(theme).media[0], css(...args)),
519
- medium: (...args) => css(["@media (min-width:", "px){", "}"], ({
520
- theme
521
- }) => getTheme_v2(theme).media[2], css(...args))
522
- }, Root = /* @__PURE__ */ styled(Grid).withConfig({
523
- displayName: "Root",
524
- componentId: "sc-1av8yx9-0"
525
- })(["grid-template-columns:repeat(auto-fit,minmax(250px,1fr));& > div{overflow:hidden;}& > div[data-width='medium']{", "}& > div[data-width='large']{", " ", "}& > div[data-width='full']{", "}& > div[data-height='medium']{", "}& > div[data-height='large']{", " ", "}& > div[data-height='full']{", "}"], media.small`
650
+ small: (...args) => css`@media (min-width:${({ theme }) => getTheme_v2(theme).media[0]}px){${css(...args)}}`,
651
+ medium: (...args) => css`@media (min-width:${({ theme }) => getTheme_v2(theme).media[2]}px){${css(...args)}}`
652
+ }, Root = styled(Grid).withConfig({
653
+ displayName: "Root",
654
+ componentId: "sc-f3tzqz-0"
655
+ })`grid-template-columns:repeat(auto-fit,minmax(250px,1fr));& > div{overflow:hidden;}& > div[data-width='medium']{${media.small`
526
656
  grid-column: span 2;
527
- `, media.small`
657
+ `}}& > div[data-width='large']{${media.small`
528
658
  grid-column: span 2;
529
- `, media.medium`
659
+ `} ${media.medium`
530
660
  grid-column: span 3;
531
- `, media.small`
661
+ `}}& > div[data-width='full']{${media.small`
532
662
  grid-column: 1 / -1;
533
- `, media.small`
663
+ `}}& > div[data-height='medium']{${media.small`
534
664
  grid-row: span 2;
535
- `, media.small`
665
+ `}}& > div[data-height='large']{${media.small`
536
666
  grid-row: span 2;
537
- `, media.medium`
667
+ `} ${media.medium`
538
668
  grid-row: span 3;
539
- `, media.medium`
669
+ `}}& > div[data-height='full']{${media.medium`
540
670
  grid-row: 1 / -1;
541
- `), NO_WIDGETS = [], NO_LAYOUT = {};
671
+ `}}`, NO_WIDGETS = [], NO_LAYOUT = {};
542
672
  function WidgetGroup(props) {
543
- const $ = c(9), {
544
- config: t0
545
- } = props, {
546
- layout: t1,
547
- widgets: t2
548
- } = t0, layout = t1 === void 0 ? NO_LAYOUT : t1, widgets = t2 === void 0 ? NO_WIDGETS : t2, t3 = layout.width || "auto", t4 = layout.height || "auto";
549
- let t5;
550
- $[0] !== widgets.length ? (t5 = widgets.length ? null : /* @__PURE__ */ jsx(Card, { padding: 4, shadow: 1, tone: "primary", children: /* @__PURE__ */ jsx(Text, { align: "center", children: "Add some widgets to populate this space." }) }), $[0] = widgets.length, $[1] = t5) : t5 = $[1];
551
- let t6;
552
- $[2] !== widgets ? (t6 = widgets.map(_temp), $[2] = widgets, $[3] = t6) : t6 = $[3];
553
- let t7;
554
- return $[4] !== t3 || $[5] !== t4 || $[6] !== t5 || $[7] !== t6 ? (t7 = /* @__PURE__ */ jsxs(Root, { autoFlow: "row dense", "data-width": t3, "data-height": t4, gap: 4, children: [
555
- t5,
556
- t6
557
- ] }), $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = t7) : t7 = $[8], t7;
673
+ let $ = c(9), { config: t0 } = props, { layout: t1, widgets: t2 } = t0, layout = t1 === void 0 ? NO_LAYOUT : t1, widgets = t2 === void 0 ? NO_WIDGETS : t2, t3 = layout.width || "auto", t4 = layout.height || "auto", t5;
674
+ $[0] === widgets.length ? t5 = $[1] : (t5 = widgets.length ? null : /* @__PURE__ */ jsx(Card, {
675
+ padding: 4,
676
+ shadow: 1,
677
+ tone: "primary",
678
+ children: /* @__PURE__ */ jsx(Text, {
679
+ align: "center",
680
+ children: "Add some widgets to populate this space."
681
+ })
682
+ }), $[0] = widgets.length, $[1] = t5);
683
+ let t6;
684
+ $[2] === widgets ? t6 = $[3] : (t6 = widgets.map(_temp), $[2] = widgets, $[3] = t6);
685
+ let t7;
686
+ return $[4] !== t3 || $[5] !== t4 || $[6] !== t5 || $[7] !== t6 ? (t7 = /* @__PURE__ */ jsxs(Root, {
687
+ autoFlow: "row dense",
688
+ "data-width": t3,
689
+ "data-height": t4,
690
+ gap: 4,
691
+ children: [t5, t6]
692
+ }), $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = t7) : t7 = $[8], t7;
558
693
  }
559
694
  function _temp(widgetConfig, index) {
560
- return widgetConfig.type === "__experimental_group" ? /* @__PURE__ */ jsx(WidgetGroup, { config: widgetConfig }, index) : widgetConfig.component ? /* @__PURE__ */ jsx(WidgetContainer, { ...widgetConfig }, index) : /* @__PURE__ */ jsxs(Box, { children: [
561
- widgetConfig.name,
562
- " is missing widget component"
563
- ] }, index);
695
+ return widgetConfig.type === "__experimental_group" ? /* @__PURE__ */ jsx(WidgetGroup, { config: widgetConfig }, index) : widgetConfig.component ? /* @__PURE__ */ jsx(WidgetContainer, { ...widgetConfig }, index) : /* @__PURE__ */ jsxs(Box, { children: [widgetConfig.name, " is missing widget component"] }, index);
564
696
  }
565
697
  function Dashboard(t0) {
566
- const $ = c(5), {
567
- config
568
- } = t0;
569
- if (!config)
570
- return null;
571
- let t1;
572
- $[0] !== config ? (t1 = /* @__PURE__ */ jsx(DashboardLayout, { children: /* @__PURE__ */ jsx(WidgetGroup, { config }) }), $[0] = config, $[1] = t1) : t1 = $[1];
573
- let t2;
574
- return $[2] !== config || $[3] !== t1 ? (t2 = /* @__PURE__ */ jsx(DashboardContext.Provider, { value: config, children: t1 }), $[2] = config, $[3] = t1, $[4] = t2) : t2 = $[4], t2;
698
+ let $ = c(5), { config } = t0;
699
+ if (!config) return null;
700
+ let t1;
701
+ $[0] === config ? t1 = $[1] : (t1 = /* @__PURE__ */ jsx(DashboardLayout, { children: /* @__PURE__ */ jsx(WidgetGroup, { config }) }), $[0] = config, $[1] = t1);
702
+ let t2;
703
+ return $[2] !== config || $[3] !== t1 ? (t2 = /* @__PURE__ */ jsx(DashboardContext.Provider, {
704
+ value: config,
705
+ children: t1
706
+ }), $[2] = config, $[3] = t1, $[4] = t2) : t2 = $[4], t2;
575
707
  }
576
708
  const strokeStyle = {
577
- stroke: "currentColor",
578
- strokeWidth: 1.2
709
+ stroke: "currentColor",
710
+ strokeWidth: 1.2
579
711
  }, DashboardIcon = () => {
580
- const $ = c(1);
581
- let t0;
582
- return $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsxs("svg", { "data-sanity-icon": !0, viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid", width: "1em", height: "1em", children: [
583
- /* @__PURE__ */ jsx("path", { d: "M19.5 19.5H5.5V5.5H19.5V19.5Z", style: strokeStyle }),
584
- /* @__PURE__ */ jsx("path", { d: "M5.5 12.5H19.5", style: strokeStyle }),
585
- /* @__PURE__ */ jsx("path", { d: "M14.5 19.5V12.5M10.5 12.5V5.5", style: strokeStyle })
586
- ] }), $[0] = t0) : t0 = $[0], t0;
712
+ let $ = c(1), t0;
713
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsxs("svg", {
714
+ "data-sanity-icon": !0,
715
+ viewBox: "0 0 25 25",
716
+ fill: "none",
717
+ xmlns: "http://www.w3.org/2000/svg",
718
+ preserveAspectRatio: "xMidYMid",
719
+ width: "1em",
720
+ height: "1em",
721
+ children: [
722
+ /* @__PURE__ */ jsx("path", {
723
+ d: "M19.5 19.5H5.5V5.5H19.5V19.5Z",
724
+ style: strokeStyle
725
+ }),
726
+ /* @__PURE__ */ jsx("path", {
727
+ d: "M5.5 12.5H19.5",
728
+ style: strokeStyle
729
+ }),
730
+ /* @__PURE__ */ jsx("path", {
731
+ d: "M14.5 19.5V12.5M10.5 12.5V5.5",
732
+ style: strokeStyle
733
+ })
734
+ ]
735
+ }), $[0] = t0) : t0 = $[0], t0;
587
736
  }, dashboardTool = definePlugin((config = {}) => {
588
- const pluginConfig = {
589
- layout: config.defaultLayout ?? {},
590
- widgets: config.widgets ?? []
591
- }, title = config.title ?? "Dashboard", name = config.name ?? "dashboard", icon = config.icon ?? DashboardIcon;
592
- return {
593
- name: "dashboard",
594
- tools: [{
595
- title,
596
- name,
597
- icon,
598
- component: () => /* @__PURE__ */ jsx(Dashboard, { config: pluginConfig })
599
- }]
600
- };
737
+ let pluginConfig = {
738
+ layout: config.defaultLayout ?? {},
739
+ widgets: config.widgets ?? []
740
+ };
741
+ return {
742
+ name: "dashboard",
743
+ tools: [{
744
+ title: config.title ?? "Dashboard",
745
+ name: config.name ?? "dashboard",
746
+ icon: config.icon ?? DashboardIcon,
747
+ component: () => /* @__PURE__ */ jsx(Dashboard, { config: pluginConfig })
748
+ }]
749
+ };
601
750
  });
602
- export {
603
- DashboardWidgetContainer,
604
- dashboardTool,
605
- projectInfoWidget,
606
- projectUsersWidget,
607
- sanityTutorialsWidget
608
- };
609
- //# sourceMappingURL=index.js.map
751
+ export { DashboardWidgetContainer, dashboardTool, projectInfoWidget, projectUsersWidget, sanityTutorialsWidget };
752
+
753
+ //# sourceMappingURL=index.js.map