@sanity/dashboard 2.30.2-shopify.2 → 3.0.0-studio-v3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -44
- package/lib/cjs/index.js +1005 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/index.js +980 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/types/index.d.ts +42 -0
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +63 -16
- package/sanity.json +2 -53
- package/src/components/DashboardLayout.tsx +10 -0
- package/src/components/DashboardWidgetContainer.tsx +69 -0
- package/src/components/NotFoundWidget.tsx +30 -0
- package/src/components/WidgetGroup.tsx +108 -0
- package/src/containers/Dashboard.tsx +19 -0
- package/src/containers/DashboardContext.tsx +8 -0
- package/src/containers/WidgetContainer.tsx +21 -0
- package/src/index.tsx +62 -0
- package/src/types.ts +21 -0
- package/src/versionedClient.ts +7 -0
- package/src/widgets/projectInfo/ProjectInfo.tsx +233 -0
- package/src/widgets/projectInfo/index.ts +10 -0
- package/src/widgets/projectUsers/ProjectUsers.tsx +170 -0
- package/src/widgets/projectUsers/index.ts +10 -0
- package/src/widgets/sanityTutorials/SanityTutorials.tsx +77 -0
- package/src/widgets/sanityTutorials/Tutorial.tsx +111 -0
- package/src/widgets/sanityTutorials/dataAdapter.ts +48 -0
- package/src/widgets/sanityTutorials/index.ts +10 -0
- package/v2-incompatible.js +11 -0
- package/.babelrc +0 -4
- package/lib/DashboardTool.js +0 -59
- package/lib/components/DashboardLayout.js +0 -35
- package/lib/components/NotFoundWidget.js +0 -51
- package/lib/components/WidgetGroup.js +0 -67
- package/lib/components/dashboardWidget.js +0 -51
- package/lib/containers/Dashboard.js +0 -32
- package/lib/containers/WidgetContainer.js +0 -56
- package/lib/dashboardConfig.js +0 -16
- package/lib/legacyParts.js +0 -55
- package/lib/versionedClient.js +0 -20
- package/lib/widget.css +0 -62
- package/lib/widgets/projectInfo/ProjectInfo.js +0 -265
- package/lib/widgets/projectInfo/index.js +0 -19
- package/lib/widgets/projectUsers/ProjectUsers.js +0 -188
- package/lib/widgets/projectUsers/index.js +0 -16
- package/lib/widgets/sanityTutorials/SanityTutorials.js +0 -115
- package/lib/widgets/sanityTutorials/Tutorial.js +0 -111
- package/lib/widgets/sanityTutorials/dataAdapter.js +0 -28
- package/lib/widgets/sanityTutorials/index.js +0 -19
- 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/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
|
-
|