@sanity/dashboard 2.30.1 → 3.0.0-sanity-v3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +123 -44
  2. package/lib/cjs/index.js +1002 -0
  3. package/lib/cjs/index.js.map +1 -0
  4. package/lib/esm/index.js +977 -0
  5. package/lib/esm/index.js.map +1 -0
  6. package/lib/types/index.d.ts +42 -0
  7. package/lib/types/index.d.ts.map +1 -0
  8. package/package.json +53 -14
  9. package/src/components/DashboardLayout.tsx +10 -0
  10. package/src/components/DashboardWidgetContainer.tsx +69 -0
  11. package/src/components/NotFoundWidget.tsx +30 -0
  12. package/src/components/WidgetGroup.tsx +108 -0
  13. package/src/containers/Dashboard.tsx +19 -0
  14. package/src/containers/DashboardContext.tsx +8 -0
  15. package/src/containers/WidgetContainer.tsx +21 -0
  16. package/src/index.tsx +62 -0
  17. package/src/types.ts +21 -0
  18. package/src/versionedClient.ts +7 -0
  19. package/src/widgets/projectInfo/ProjectInfo.tsx +233 -0
  20. package/src/widgets/projectInfo/index.ts +10 -0
  21. package/src/widgets/projectUsers/ProjectUsers.tsx +171 -0
  22. package/src/widgets/projectUsers/index.ts +10 -0
  23. package/src/widgets/sanityTutorials/SanityTutorials.tsx +77 -0
  24. package/src/widgets/sanityTutorials/Tutorial.tsx +111 -0
  25. package/src/widgets/sanityTutorials/dataAdapter.ts +48 -0
  26. package/src/widgets/sanityTutorials/index.ts +10 -0
  27. package/.babelrc +0 -4
  28. package/lib/DashboardTool.js +0 -59
  29. package/lib/components/DashboardLayout.js +0 -35
  30. package/lib/components/NotFoundWidget.js +0 -51
  31. package/lib/components/WidgetGroup.js +0 -67
  32. package/lib/components/dashboardWidget.js +0 -51
  33. package/lib/containers/Dashboard.js +0 -32
  34. package/lib/containers/WidgetContainer.js +0 -56
  35. package/lib/dashboardConfig.js +0 -16
  36. package/lib/legacyParts.js +0 -55
  37. package/lib/versionedClient.js +0 -20
  38. package/lib/widget.css +0 -62
  39. package/lib/widgets/projectInfo/ProjectInfo.js +0 -265
  40. package/lib/widgets/projectInfo/index.js +0 -19
  41. package/lib/widgets/projectUsers/ProjectUsers.js +0 -188
  42. package/lib/widgets/projectUsers/index.js +0 -16
  43. package/lib/widgets/sanityTutorials/SanityTutorials.js +0 -115
  44. package/lib/widgets/sanityTutorials/Tutorial.js +0 -111
  45. package/lib/widgets/sanityTutorials/dataAdapter.js +0 -28
  46. package/lib/widgets/sanityTutorials/index.js +0 -19
  47. package/sanity.json +0 -59
  48. package/tsconfig.json +0 -17
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _ui = require("@sanity/ui");
13
-
14
- var _icons = require("@sanity/icons");
15
-
16
- var _styledComponents = _interopRequireDefault(require("styled-components"));
17
-
18
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
24
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
25
-
26
- var PlayIconBox = (0, _styledComponents.default)(_ui.Box)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 2.75em;\n height: 2.75em;\n border-radius: 50%;\n background: ", ";\n opacity: 0.75;\n }\n"])), _ref => {
27
- var theme = _ref.theme;
28
- return theme.sanity.color.card.enabled.bg;
29
- });
30
- var Root = (0, _styledComponents.default)(_ui.Flex)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:hover {\n ", " {\n &:before {\n opacity: 1;\n }\n }\n }\n"])), PlayIconBox);
31
- var PosterCard = (0, _styledComponents.default)(_ui.Card)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n padding-bottom: calc(9 / 16 * 100%);\n position: relative;\n"])));
32
-
33
- var Poster = _styledComponents.default.img(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n object-fit: cover;\n display: block;\n\n &:not([src]) {\n display: none;\n }\n"])));
34
-
35
- class Tutorial extends _react.default.PureComponent {
36
- render() {
37
- var _this$props = this.props,
38
- title = _this$props.title,
39
- posterURL = _this$props.posterURL,
40
- showPlayIcon = _this$props.showPlayIcon,
41
- href = _this$props.href,
42
- presenterName = _this$props.presenterName,
43
- presenterSubtitle = _this$props.presenterSubtitle;
44
- return /*#__PURE__*/_react.default.createElement(Root, {
45
- flex: 1
46
- }, /*#__PURE__*/_react.default.createElement(_ui.Card, {
47
- sizing: "border",
48
- flex: 1,
49
- padding: 2,
50
- radius: 2,
51
- as: "a",
52
- href: href,
53
- target: "_blank",
54
- rel: "noopener noreferrer",
55
- style: {
56
- position: 'relative'
57
- }
58
- }, /*#__PURE__*/_react.default.createElement(_ui.Flex, {
59
- direction: "column",
60
- style: {
61
- height: '100%'
62
- }
63
- }, posterURL && /*#__PURE__*/_react.default.createElement(PosterCard, {
64
- marginBottom: 1
65
- }, /*#__PURE__*/_react.default.createElement(Poster, {
66
- src: posterURL
67
- }), showPlayIcon && /*#__PURE__*/_react.default.createElement(PlayIconBox, {
68
- display: "flex"
69
- }, /*#__PURE__*/_react.default.createElement(_ui.Text, {
70
- align: "center"
71
- }, /*#__PURE__*/_react.default.createElement(_icons.PlayIcon, null)))), /*#__PURE__*/_react.default.createElement(_ui.Flex, {
72
- direction: "column",
73
- justify: "space-between",
74
- paddingY: 2,
75
- flex: 1
76
- }, /*#__PURE__*/_react.default.createElement(_ui.Heading, {
77
- as: "h3",
78
- size: 1
79
- }, title), /*#__PURE__*/_react.default.createElement(_ui.Box, {
80
- marginTop: 4
81
- }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
82
- space: 2,
83
- flex: 1
84
- }, /*#__PURE__*/_react.default.createElement(_ui.Text, {
85
- size: 1
86
- }, presenterName), /*#__PURE__*/_react.default.createElement(_ui.Text, {
87
- size: 0,
88
- style: {
89
- opacity: 0.7
90
- }
91
- }, presenterSubtitle)))))));
92
- }
93
-
94
- }
95
-
96
- _defineProperty(Tutorial, "propTypes", {
97
- title: _propTypes.default.string.isRequired,
98
- posterURL: _propTypes.default.string,
99
- href: _propTypes.default.string.isRequired,
100
- showPlayIcon: _propTypes.default.bool,
101
- presenterName: _propTypes.default.string.isRequired,
102
- presenterSubtitle: _propTypes.default.string.isRequired
103
- });
104
-
105
- _defineProperty(Tutorial, "defaultProps", {
106
- posterURL: null,
107
- showPlayIcon: false
108
- });
109
-
110
- var _default = Tutorial;
111
- exports.default = _default;
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _imageUrl = _interopRequireDefault(require("@sanity/image-url"));
9
-
10
- var _versionedClient = require("../../versionedClient");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- var tutorialsProjectConfig = {
15
- projectId: '3do82whm',
16
- dataset: 'next'
17
- };
18
- var _default = {
19
- getFeed: templateRepoId => {
20
- var uri = templateRepoId ? "/addons/dashboard?templateRepoId=".concat(templateRepoId) : '/addons/dashboard';
21
- return _versionedClient.versionedClient.observable.request({
22
- uri,
23
- withCredentials: false
24
- });
25
- },
26
- urlBuilder: (0, _imageUrl.default)(tutorialsProjectConfig)
27
- };
28
- exports.default = _default;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _SanityTutorials = _interopRequireDefault(require("./SanityTutorials"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- var _default = {
13
- name: 'sanity-tutorials',
14
- component: _SanityTutorials.default,
15
- layout: {
16
- width: 'full'
17
- }
18
- };
19
- exports.default = _default;
package/sanity.json DELETED
@@ -1,59 +0,0 @@
1
- {
2
- "paths": {
3
- "source": "./src",
4
- "compiled": "./lib"
5
- },
6
- "parts": [
7
- {
8
- "implements": "part:@sanity/base/tool",
9
- "path": "DashboardTool"
10
- },
11
- {
12
- "implements": "part:@sanity/base/component",
13
- "path": "components/story"
14
- },
15
- {
16
- "name": "part:@sanity/dashboard/config",
17
- "description": "Tool for rendering dashboard widgets"
18
- },
19
- {
20
- "implements": "part:@sanity/dashboard/config",
21
- "path": "dashboardConfig"
22
- },
23
- {
24
- "name": "part:@sanity/dashboard/widget",
25
- "description": "Anything suitable for the dashboard"
26
- },
27
- {
28
- "name": "part:@sanity/dashboard/widget/sanity-tutorials",
29
- "implements": "part:@sanity/dashboard/widget",
30
- "path": "widgets/sanityTutorials"
31
- },
32
- {
33
- "name": "part:@sanity/dashboard/widget/project-info",
34
- "implements": "part:@sanity/dashboard/widget",
35
- "path": "widgets/projectInfo"
36
- },
37
- {
38
- "name": "part:@sanity/dashboard/widget/project-users",
39
- "implements": "part:@sanity/dashboard/widget",
40
- "path": "widgets/projectUsers"
41
- },
42
- {
43
- "name": "part:@sanity/dashboard/widget-styles",
44
- "description": "Provides pseudo styles for selectable items"
45
- },
46
- {
47
- "implements": "part:@sanity/dashboard/widget-styles",
48
- "path": "widget.css"
49
- },
50
- {
51
- "name": "part:@sanity/dashboard/widget-container",
52
- "description": "A container component that resolves and renders widget components"
53
- },
54
- {
55
- "implements": "part:@sanity/dashboard/widget-container",
56
- "path": "containers/WidgetContainer"
57
- }
58
- ]
59
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig",
3
- "include": ["src"],
4
- "compilerOptions": {
5
- "composite": true,
6
- "outDir": "./dist/dts",
7
- "rootDir": "./src",
8
- "jsx": "react",
9
- "noImplicitAny": false
10
- },
11
- "references": [
12
- {
13
- "path": "../base"
14
- },
15
- ]
16
- }
17
-