@sanity/dashboard 5.0.1 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -51
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +605 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -79
- package/lib/index.d.mts +0 -65
- package/lib/index.d.ts +0 -65
- package/lib/index.esm.js +0 -568
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -564
- package/lib/index.js.map +0 -1
- package/lib/index.mjs +0 -568
- package/lib/index.mjs.map +0 -1
- package/sanity.json +0 -8
- package/src/components/DashboardLayout.tsx +0 -10
- package/src/components/DashboardWidgetContainer.tsx +0 -69
- package/src/components/NotFoundWidget.tsx +0 -30
- package/src/components/WidgetGroup.tsx +0 -106
- package/src/containers/Dashboard.tsx +0 -19
- package/src/containers/DashboardContext.tsx +0 -8
- package/src/containers/WidgetContainer.tsx +0 -21
- package/src/index.ts +0 -7
- package/src/plugin.tsx +0 -72
- package/src/types.ts +0 -21
- package/src/versionedClient.ts +0 -5
- package/src/widgets/projectInfo/ProjectInfo.tsx +0 -221
- package/src/widgets/projectInfo/index.ts +0 -10
- package/src/widgets/projectInfo/types.ts +0 -28
- package/src/widgets/projectUsers/ProjectUser.tsx +0 -45
- package/src/widgets/projectUsers/ProjectUsers.tsx +0 -148
- package/src/widgets/projectUsers/index.ts +0 -10
- package/src/widgets/sanityTutorials/SanityTutorials.tsx +0 -77
- package/src/widgets/sanityTutorials/Tutorial.tsx +0 -111
- package/src/widgets/sanityTutorials/dataAdapter.ts +0 -49
- package/src/widgets/sanityTutorials/index.ts +0 -10
- package/v2-incompatible.js +0 -11
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/dashboard/tree/studio-v2).
|
|
1
|
+
# @sanity/dashboard
|
|
4
2
|
|
|
5
3
|
## What is it?
|
|
6
4
|
|
|
@@ -60,7 +58,7 @@ dashboardTool({
|
|
|
60
58
|
Widgets can be configured by passing widget-specific config:
|
|
61
59
|
|
|
62
60
|
```ts
|
|
63
|
-
projectUsersWidget({layout: 'medium'})
|
|
61
|
+
projectUsersWidget({layout: {width: 'medium'}})
|
|
64
62
|
```
|
|
65
63
|
|
|
66
64
|
You can change the name, title and icon of the dashboard tool should you want to - which also allows you to configure multiple dashboards with different configurations:
|
|
@@ -153,56 +151,12 @@ Setting up the widget with the default setup will give you a basic widget that l
|
|
|
153
151
|
|
|
154
152
|
You can study the source code of these widgets to get a sense of how you can approach fetching of documents, adding configuration, and so on:
|
|
155
153
|
|
|
156
|
-
- [dashboard-widget-document-list](https://github.com/sanity-io/dashboard-widget-document-list)
|
|
157
|
-
- [dashboard-widget-
|
|
158
|
-
- [dashboard-widget-netlify](https://github.com/sanity-io/sanity-plugin-dashboard-widget-netlify)
|
|
154
|
+
- [dashboard-widget-document-list](https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-dashboard-widget-document-list)
|
|
155
|
+
- [dashboard-widget-vercel](https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-dashboard-widget-vercel)
|
|
156
|
+
- [dashboard-widget-netlify](https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-dashboard-widget-netlify)
|
|
159
157
|
|
|
160
158
|
---
|
|
161
159
|
|
|
162
|
-
### Upgrading from v2
|
|
163
|
-
|
|
164
|
-
If you were previously using @sanity/dashboard in a v2 Sanity Studio, will have to make the following changes:
|
|
165
|
-
|
|
166
|
-
- Install the v3 version of @sanity/dashboard in the Studio
|
|
167
|
-
- Install v3 versions of any widgets
|
|
168
|
-
- Configure the dashboard as described above:
|
|
169
|
-
- Add dashboardTool to plugins array
|
|
170
|
-
- Add widgets to widgets configuration
|
|
171
|
-
- Move any config you had in v2 `dashboardConfiguration.js` on a widget-by-widget basis.
|
|
172
|
-
- V2 used an options-object to pass widget-specific configuration. In v3, options have been replaced by
|
|
173
|
-
passing the same configuration directly to the widget-function.
|
|
174
|
-
- Custom widget components should import DashboardWidgetContainer instead of DashboardWidget
|
|
175
|
-
|
|
176
|
-
## Develop & test
|
|
177
|
-
|
|
178
|
-
This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
|
|
179
|
-
with default configuration for build & watch scripts.
|
|
180
|
-
|
|
181
|
-
See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
|
|
182
|
-
on how to run this plugin with hotreload in the studio.
|
|
183
|
-
|
|
184
|
-
### Release new version
|
|
185
|
-
|
|
186
|
-
Run ["CI & Release" workflow](https://github.com/sanity-io/dashboard/actions/workflows/main.yml).
|
|
187
|
-
Make sure to select the main branch and check "Release new version".
|
|
188
|
-
|
|
189
|
-
Semantic release will only release on configured branches, so it is safe to run release on any branch.
|
|
190
|
-
|
|
191
160
|
## License
|
|
192
161
|
|
|
193
162
|
MIT-licensed. See LICENSE.
|
|
194
|
-
|
|
195
|
-
## Develop & test
|
|
196
|
-
|
|
197
|
-
This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
|
|
198
|
-
with default configuration for build & watch scripts.
|
|
199
|
-
|
|
200
|
-
See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
|
|
201
|
-
on how to run this plugin with hotreload in the studio.
|
|
202
|
-
|
|
203
|
-
### Release new version
|
|
204
|
-
|
|
205
|
-
Run ["CI & Release" workflow](https://github.com/sanity-io/dashboard/actions/workflows/main.yml).
|
|
206
|
-
Make sure to select the main branch and check "Release new version".
|
|
207
|
-
|
|
208
|
-
Semantic release will only release on configured branches, so it is safe to run release on any branch.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { ComponentClass, ComponentType, FunctionComponent } from "react";
|
|
2
|
+
interface DashboardWidget {
|
|
3
|
+
name: string;
|
|
4
|
+
type?: '__experimental_group';
|
|
5
|
+
component: FunctionComponent<any> | ComponentClass<any>;
|
|
6
|
+
layout?: LayoutConfig;
|
|
7
|
+
widgets?: DashboardWidget[];
|
|
8
|
+
}
|
|
9
|
+
type LayoutSize = 'auto' | 'small' | 'medium' | 'large' | 'full';
|
|
10
|
+
interface LayoutConfig {
|
|
11
|
+
width?: LayoutSize;
|
|
12
|
+
height?: LayoutSize;
|
|
13
|
+
}
|
|
14
|
+
interface DashboardConfig {
|
|
15
|
+
widgets: DashboardWidget[];
|
|
16
|
+
layout?: LayoutConfig;
|
|
17
|
+
}
|
|
18
|
+
interface DashboardWidgetProps {
|
|
19
|
+
header?: string;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
footer?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const DashboardWidgetContainer: React.ForwardRefExoticComponent<DashboardWidgetProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare function projectInfoWidget(config?: {
|
|
25
|
+
layout?: LayoutConfig;
|
|
26
|
+
}): DashboardWidget;
|
|
27
|
+
declare function projectUsersWidget(config?: {
|
|
28
|
+
layout?: LayoutConfig;
|
|
29
|
+
}): DashboardWidget;
|
|
30
|
+
declare function sanityTutorialsWidget(config?: {
|
|
31
|
+
layout?: LayoutConfig;
|
|
32
|
+
}): DashboardWidget;
|
|
33
|
+
interface DashboardPluginConfig {
|
|
34
|
+
/**
|
|
35
|
+
* Dashboard tool title
|
|
36
|
+
*/
|
|
37
|
+
title?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Dashboard tool name (used in url path)
|
|
40
|
+
*/
|
|
41
|
+
name?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Dashboard tool icon
|
|
44
|
+
*/
|
|
45
|
+
icon?: ComponentType;
|
|
46
|
+
widgets?: DashboardWidget[];
|
|
47
|
+
/**
|
|
48
|
+
* Will be used for widgets that do not define a layout directly.
|
|
49
|
+
*/
|
|
50
|
+
defaultLayout?: LayoutConfig;
|
|
51
|
+
}
|
|
52
|
+
declare const dashboardTool: import("sanity").Plugin<DashboardPluginConfig>;
|
|
53
|
+
export { DashboardConfig, type DashboardPluginConfig, DashboardWidget, DashboardWidgetContainer, LayoutConfig, LayoutSize, dashboardTool, projectInfoWidget, projectUsersWidget, sanityTutorialsWidget };
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/components/DashboardWidgetContainer.tsx","../src/widgets/projectInfo/index.ts","../src/widgets/projectUsers/index.ts","../src/widgets/sanityTutorials/index.ts","../src/plugin.tsx"],"mappings":";UAEiB,eAAA;EACf,IAAA;EACA,IAAA;EACA,SAAA,EAAW,iBAAA,QAAyB,cAAA;EACpC,MAAA,GAAS,YAAA;EACT,OAAA,GAAU,eAAA;AAAA;AAAA,KAGA,UAAA;AAAA,UAEK,YAAA;EACf,KAAA,GAAQ,UAAA;EACR,MAAA,GAAS,UAAU;AAAA;AAAA,UAGJ,eAAA;EACf,OAAA,EAAS,eAAA;EACT,MAAA,GAAS,YAAY;AAAA;AAAA,UCyBb,oBAAA;EACR,MAAA;EACA,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,MAAA,GAAS,KAAA,CAAM,SAAS;AAAA;AAAA,cAGb,wBAAA,EAAwB,KAAA,CAAA,yBAAA,CAAA,oBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,iBC/CrB,iBAAA,CAAkB,MAAA;EAAU,MAAA,GAAS,YAAA;AAAA,IAAgB,eAAe;AAAA,iBCApE,kBAAA,CAAmB,MAAA;EAAU,MAAA,GAAS,YAAA;AAAA,IAAgB,eAAe;AAAA,iBCArE,qBAAA,CAAsB,MAAA;EAAU,MAAA,GAAS,YAAA;AAAA,IAAgB,eAAe;AAAA,UCwBvE,qBAAA;ELzBe;;;EK6B9B,KAAA;ELzBS;;;EK6BT,IAAA;ELhCA;;;EKoCA,IAAA,GAAO,aAAA;EACP,OAAA,GAAU,eAAA;ELlCV;;;EKuCA,aAAA,GAAgB,YAAA;AAAA;AAAA,cAGL,aAAA,mBAAa,MAAA,CAAA,qBAAA"}
|