@pingux/astro 1.8.0-alpha.0 → 1.8.0-alpha.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/lib/cjs/components/CodeView/CodeView.js +11 -4
- package/lib/cjs/components/CodeView/CodeView.stories.js +33 -2
- package/lib/cjs/components/Image/Image.js +132 -11
- package/lib/cjs/components/Image/Image.stories.js +52 -6
- package/lib/cjs/components/Image/Image.test.js +138 -2
- package/lib/cjs/components/Image/imageConstants.js +13 -0
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +27 -8
- package/lib/cjs/hooks/index.js +10 -1
- package/lib/cjs/hooks/useFallbackImage/index.js +18 -0
- package/lib/cjs/hooks/useFallbackImage/useFallbackImage.js +46 -0
- package/lib/cjs/hooks/useFallbackImage/useFallbackImage.test.js +65 -0
- package/lib/components/CodeView/CodeView.js +12 -5
- package/lib/components/CodeView/CodeView.stories.js +26 -0
- package/lib/components/Image/Image.js +123 -9
- package/lib/components/Image/Image.stories.js +39 -4
- package/lib/components/Image/Image.test.js +118 -1
- package/lib/components/Image/imageConstants.js +2 -0
- package/lib/components/ImageUploadField/ImageUploadField.test.js +27 -7
- package/lib/hooks/index.js +2 -1
- package/lib/hooks/useFallbackImage/index.js +1 -0
- package/lib/hooks/useFallbackImage/useFallbackImage.js +32 -0
- package/lib/hooks/useFallbackImage/useFallbackImage.test.js +51 -0
- package/package.json +2 -1
@@ -58,7 +58,7 @@ var _codeView = _interopRequireDefault(require("../../styles/variants/codeView")
|
|
58
58
|
|
59
59
|
var _react2 = require("@emotion/react");
|
60
60
|
|
61
|
-
var _excluded = ["children", "className", "hasLineNumbers", "hasNoCopyButton", "language"];
|
61
|
+
var _excluded = ["children", "className", "hasLineNumbers", "hasNoCopyButton", "language", "Prism"];
|
62
62
|
|
63
63
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
64
64
|
|
@@ -78,6 +78,7 @@ var CodeView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
78
78
|
hasLineNumbers = props.hasLineNumbers,
|
79
79
|
hasNoCopyButton = props.hasNoCopyButton,
|
80
80
|
language = props.language,
|
81
|
+
customPrism = props.Prism,
|
81
82
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
82
83
|
|
83
84
|
var _useFocusRing = (0, _focus.useFocusRing)(),
|
@@ -104,7 +105,8 @@ var CodeView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
104
105
|
var content = (0, _react2.jsx)(_prismReactRenderer["default"], (0, _extends2["default"])({}, _prismReactRenderer.defaultProps, {
|
105
106
|
theme: _codeView["default"].theme,
|
106
107
|
code: (children === null || children === void 0 ? void 0 : (0, _trim["default"])(children).call(children)) || '',
|
107
|
-
language: language
|
108
|
+
language: language,
|
109
|
+
Prism: customPrism || _prismReactRenderer.Prism
|
108
110
|
}), function (_ref) {
|
109
111
|
var className = _ref.className,
|
110
112
|
style = _ref.style,
|
@@ -168,9 +170,14 @@ CodeView.propTypes = {
|
|
168
170
|
* Which programming language the CodeView should use for highlighting. A list of default languages is listed [here](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js).
|
169
171
|
*
|
170
172
|
*
|
171
|
-
* Additional languages may be added, see
|
173
|
+
* Additional languages may be added, see
|
174
|
+
* [CodeView with additional language](./?path=/docs/codeview--with-additional-language)
|
175
|
+
* for more information.
|
172
176
|
*/
|
173
|
-
language: _propTypes["default"].string
|
177
|
+
language: _propTypes["default"].string,
|
178
|
+
|
179
|
+
/* Prism object for using instead of Prism from "react-prism-renderer" */
|
180
|
+
Prism: _propTypes["default"].shape({})
|
174
181
|
};
|
175
182
|
CodeView.defaultProps = {
|
176
183
|
language: 'json',
|
@@ -8,10 +8,16 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports["default"] = exports.WithLineNumbers = exports.WithCustomSize = exports.Default = void 0;
|
11
|
+
exports["default"] = exports.WithLineNumbers = exports.WithCustomSize = exports.WithAdditionalLanguage = exports.Default = void 0;
|
12
|
+
|
13
|
+
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
12
14
|
|
13
15
|
var _react = _interopRequireDefault(require("react"));
|
14
16
|
|
17
|
+
var _prismjs = _interopRequireDefault(require("prismjs"));
|
18
|
+
|
19
|
+
require("prismjs/components/prism-powershell");
|
20
|
+
|
15
21
|
var _CodeView = _interopRequireDefault(require("./CodeView"));
|
16
22
|
|
17
23
|
var _ = require("../..");
|
@@ -31,6 +37,9 @@ var _default = {
|
|
31
37
|
control: {
|
32
38
|
type: 'text'
|
33
39
|
}
|
40
|
+
},
|
41
|
+
Prism: {
|
42
|
+
control: 'none'
|
34
43
|
}
|
35
44
|
},
|
36
45
|
parameters: {
|
@@ -88,4 +97,26 @@ var WithCustomSize = function WithCustomSize() {
|
|
88
97
|
}, "\nexport const ChipWithIcon = () => (\n <>\n <Chip label=\"Chip with Icon Button\" bg=\"navy\">\n <IconButton aria-label=\"Clear Chip with Icon Button\" variant=\"inverted\">\n <Icon icon={Clear} ml=\"xs\" size=\"14px\" />\n </IconButton>\n </Chip>\n\n <div style={{ padding: '5px' }} />\n\n <Chip label=\"Chip with Icon Button\">\n <IconButton aria-label=\"Clear Chip with Icon Button\" variant=\"inverted\">\n <Icon icon={Earth} ml=\"xs\" size=\"14px\" />\n </IconButton>\n </Chip>\n\n <div style={{ padding: '5px' }} />\n\n <Chip label=\"Chip with Icon\" bg=\"green\">\n <Icon icon={ContentCopy} ml=\"xs\" size=\"14px\" color=\"white\" />\n </Chip>\n </>\n);\n "));
|
89
98
|
};
|
90
99
|
|
91
|
-
exports.WithCustomSize = WithCustomSize;
|
100
|
+
exports.WithCustomSize = WithCustomSize;
|
101
|
+
|
102
|
+
var WithAdditionalLanguage = function WithAdditionalLanguage() {
|
103
|
+
var _context;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* import { CodeView } from "@pingux/astro";
|
107
|
+
* import Prism from 'prismjs';
|
108
|
+
* import 'prismjs/components/prism-powershell';
|
109
|
+
*/
|
110
|
+
var powershellCode = (0, _trim["default"])(_context = "\n Get-WinEvent -FilterHashtable @{\n LogName='Application'\n ProviderName='*defrag'\n }\n ").call(_context);
|
111
|
+
return (0, _react2.jsx)(_CodeView["default"], {
|
112
|
+
language: "powershell",
|
113
|
+
Prism: _prismjs["default"]
|
114
|
+
}, powershellCode);
|
115
|
+
};
|
116
|
+
|
117
|
+
exports.WithAdditionalLanguage = WithAdditionalLanguage;
|
118
|
+
WithAdditionalLanguage.parameters = {
|
119
|
+
docs: {
|
120
|
+
storyDescription: 'All available languages are listed [here](https://github.com/PrismJS/prism/tree/master/components).'
|
121
|
+
}
|
122
|
+
};
|
@@ -2,13 +2,25 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
4
|
|
5
|
-
var
|
5
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
6
|
+
|
7
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
6
8
|
|
7
9
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
8
10
|
|
9
|
-
var
|
11
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
10
12
|
|
11
|
-
var
|
13
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
14
|
+
|
15
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
16
|
+
|
17
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
18
|
+
|
19
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
20
|
+
|
21
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
22
|
+
|
23
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
12
24
|
|
13
25
|
_Object$defineProperty(exports, "__esModule", {
|
14
26
|
value: true
|
@@ -18,6 +30,12 @@ exports["default"] = void 0;
|
|
18
30
|
|
19
31
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
20
32
|
|
33
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/taggedTemplateLiteral"));
|
34
|
+
|
35
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
36
|
+
|
37
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
38
|
+
|
21
39
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
22
40
|
|
23
41
|
var _react = _interopRequireWildcard(require("react"));
|
@@ -28,16 +46,26 @@ var _themeUi = require("theme-ui");
|
|
28
46
|
|
29
47
|
var _interactions = require("@react-aria/interactions");
|
30
48
|
|
49
|
+
var _react2 = require("@emotion/react");
|
50
|
+
|
31
51
|
var _hooks = require("../../hooks");
|
32
52
|
|
33
|
-
var
|
53
|
+
var _index = require("../../index");
|
54
|
+
|
55
|
+
var _colors = require("../../styles/colors");
|
34
56
|
|
35
|
-
var
|
57
|
+
var _templateObject;
|
58
|
+
|
59
|
+
var _excluded = ["className", "fallbackImage", "fallbackTimeout", "isDisabled", "src", "sx"];
|
36
60
|
|
37
61
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
38
62
|
|
39
63
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
40
64
|
|
65
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
66
|
+
|
67
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
68
|
+
|
41
69
|
/**
|
42
70
|
* Basic image component.
|
43
71
|
* Built on top of [Image from Theme-UI](https://theme-ui.com/components/image/).
|
@@ -45,8 +73,37 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
45
73
|
*/
|
46
74
|
var Image = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
47
75
|
var className = props.className,
|
76
|
+
fallbackImage = props.fallbackImage,
|
77
|
+
fallbackTimeout = props.fallbackTimeout,
|
48
78
|
isDisabled = props.isDisabled,
|
79
|
+
src = props.src,
|
80
|
+
sx = props.sx,
|
49
81
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
82
|
+
|
83
|
+
var _useState = (0, _react.useState)(true),
|
84
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
85
|
+
isLoading = _useState2[0],
|
86
|
+
setIsLoading = _useState2[1];
|
87
|
+
|
88
|
+
var _useState3 = (0, _react.useState)(false),
|
89
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
90
|
+
loadedSuccessfully = _useState4[0],
|
91
|
+
setLoadedSuccessfully = _useState4[1]; // we need to use useRef here with useState so it will be updated in setTimeout and onload
|
92
|
+
// https://github.com/facebook/react/issues/14010#issuecomment-433788147
|
93
|
+
|
94
|
+
|
95
|
+
var isLoadingRef = (0, _react.useRef)(isLoading);
|
96
|
+
|
97
|
+
var setIsLoadingWithRef = function setIsLoadingWithRef(newState) {
|
98
|
+
setIsLoading(newState);
|
99
|
+
isLoadingRef.current = newState;
|
100
|
+
};
|
101
|
+
|
102
|
+
var _useState5 = (0, _react.useState)(fallbackImage || src),
|
103
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
104
|
+
imgSrc = _useState6[0],
|
105
|
+
setImgSrc = _useState6[1];
|
106
|
+
|
50
107
|
var imgRef = (0, _react.useRef)();
|
51
108
|
/* istanbul ignore next */
|
52
109
|
|
@@ -61,16 +118,68 @@ var Image = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
61
118
|
|
62
119
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
63
120
|
isDisabled: isDisabled,
|
64
|
-
isHovered: isHovered
|
121
|
+
isHovered: isHovered,
|
122
|
+
isLoading: isLoading
|
65
123
|
}),
|
66
124
|
classNames = _useStatusClasses.classNames;
|
67
125
|
|
68
|
-
|
126
|
+
var onImageLoad = function onImageLoad() {
|
127
|
+
if (isLoadingRef !== null && isLoadingRef !== void 0 && isLoadingRef.current) {
|
128
|
+
setIsLoadingWithRef(false);
|
129
|
+
setImgSrc(src);
|
130
|
+
setLoadedSuccessfully(true);
|
131
|
+
}
|
132
|
+
};
|
133
|
+
|
134
|
+
var onImageError = function onImageError() {
|
135
|
+
setIsLoadingWithRef(false);
|
136
|
+
setImgSrc(fallbackImage || null);
|
137
|
+
};
|
138
|
+
|
139
|
+
var onFallbackTimeout = function onFallbackTimeout() {
|
140
|
+
if (isLoadingRef !== null && isLoadingRef !== void 0 && isLoadingRef.current) {
|
141
|
+
setIsLoadingWithRef(false);
|
142
|
+
setImgSrc(fallbackImage || null);
|
143
|
+
}
|
144
|
+
};
|
145
|
+
|
146
|
+
(0, _hooks.useFallbackImage)(_objectSpread({
|
147
|
+
onImageLoad: onImageLoad,
|
148
|
+
onImageError: onImageError,
|
149
|
+
onFallbackTimeout: onFallbackTimeout
|
150
|
+
}, props));
|
151
|
+
var skeletonFrames = (0, _react2.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n 0% {\n background-color: ", ";\n }\n 100% {\n background-color: ", ";\n }\n"])), _colors.neutral[90], _colors.neutral[70]);
|
152
|
+
var skeletonSx = {
|
153
|
+
backgroundColor: _colors.neutral[90],
|
154
|
+
// eslint-disable-next-line react/prop-types
|
155
|
+
width: (sx === null || sx === void 0 ? void 0 : sx.width) || '100%',
|
156
|
+
// eslint-disable-next-line react/prop-types
|
157
|
+
height: (sx === null || sx === void 0 ? void 0 : sx.height) || '100%',
|
158
|
+
animation: isLoading && "".concat(skeletonFrames, " 1.5s ease-in-out 0.5s infinite alternate")
|
159
|
+
};
|
160
|
+
|
161
|
+
var Skeleton = function Skeleton(_ref) {
|
162
|
+
var children = _ref.children;
|
163
|
+
return (0, _react2.jsx)(_index.Box, {
|
164
|
+
sx: skeletonSx,
|
165
|
+
"data-testid": "skeleton-image"
|
166
|
+
}, children);
|
167
|
+
};
|
168
|
+
|
169
|
+
var themeUiImage = (0, _react2.jsx)(_themeUi.Image, (0, _extends2["default"])({
|
69
170
|
className: classNames,
|
70
171
|
ref: imgRef,
|
71
172
|
alt: "Image",
|
72
|
-
role: "img"
|
173
|
+
role: "img",
|
174
|
+
src: imgSrc,
|
175
|
+
sx: sx
|
73
176
|
}, others, hoverProps));
|
177
|
+
|
178
|
+
if (isLoading || !loadedSuccessfully && !fallbackImage) {
|
179
|
+
return (0, _react2.jsx)(Skeleton, null);
|
180
|
+
}
|
181
|
+
|
182
|
+
return themeUiImage;
|
74
183
|
});
|
75
184
|
Image.propTypes = {
|
76
185
|
/** The styling variation of the image. */
|
@@ -82,12 +191,24 @@ Image.propTypes = {
|
|
82
191
|
/** The HTML element used to render the image. */
|
83
192
|
as: _propTypes["default"].string,
|
84
193
|
|
85
|
-
/** Source of image. */
|
86
|
-
src: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])
|
194
|
+
/** Source of image(Image path). */
|
195
|
+
src: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
|
196
|
+
|
197
|
+
/** Load failure fault-tolerant src
|
198
|
+
* We do recommend using JS File or Blob object as an src for the "fallbackImage".
|
199
|
+
* Here is some documentation on how to create a blob image [https://developer.mozilla.org/en-US/docs/Web/API/Blob].
|
200
|
+
* Also please note that URLs are accepted, but if the URL cannot be loaded,
|
201
|
+
* the fallback image will not be rendered so it's not recommended.
|
202
|
+
* */
|
203
|
+
fallbackImage: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
|
204
|
+
|
205
|
+
/** Time in milliseconds that component should wait for a response from src address. */
|
206
|
+
fallbackTimeout: _propTypes["default"].number
|
87
207
|
};
|
88
208
|
Image.defaultProps = {
|
89
209
|
isDisabled: false,
|
90
|
-
as: 'img'
|
210
|
+
as: 'img',
|
211
|
+
fallbackTimeout: 5000
|
91
212
|
};
|
92
213
|
Image.displayName = 'Image';
|
93
214
|
var _default = Image;
|
@@ -8,14 +8,18 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports["default"] = exports.Disabled = exports.Default = exports.CustomSizeAndRadius = exports.Avatar = void 0;
|
11
|
+
exports["default"] = exports.WithSkeletonLoadTimeout = exports.WithSkeletonLoadSuccess = exports.FallbackImage = exports.Disabled = exports.Default = exports.CustomSizeAndRadius = exports.Avatar = void 0;
|
12
12
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
14
14
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
16
16
|
|
17
|
+
var _isChromatic = _interopRequireDefault(require("chromatic/isChromatic"));
|
18
|
+
|
17
19
|
var _ = _interopRequireDefault(require("."));
|
18
20
|
|
21
|
+
var _imageConstants = require("./imageConstants");
|
22
|
+
|
19
23
|
var _htmlElements = require("../../utils/devUtils/constants/htmlElements");
|
20
24
|
|
21
25
|
var _react2 = require("@emotion/react");
|
@@ -41,7 +45,7 @@ var _default = {
|
|
41
45
|
control: {
|
42
46
|
type: 'none'
|
43
47
|
},
|
44
|
-
defaultValue:
|
48
|
+
defaultValue: _imageConstants.pingImg
|
45
49
|
}
|
46
50
|
}
|
47
51
|
};
|
@@ -56,7 +60,7 @@ exports.Default = Default;
|
|
56
60
|
|
57
61
|
var Avatar = function Avatar() {
|
58
62
|
return (0, _react2.jsx)(_["default"], {
|
59
|
-
src:
|
63
|
+
src: _imageConstants.pingImg,
|
60
64
|
variant: "images.avatar"
|
61
65
|
});
|
62
66
|
};
|
@@ -65,7 +69,7 @@ exports.Avatar = Avatar;
|
|
65
69
|
|
66
70
|
var CustomSizeAndRadius = function CustomSizeAndRadius() {
|
67
71
|
return (0, _react2.jsx)(_["default"], {
|
68
|
-
src:
|
72
|
+
src: _imageConstants.chiefIdentityChampions,
|
69
73
|
sx: {
|
70
74
|
width: '70px',
|
71
75
|
height: '70px',
|
@@ -79,9 +83,51 @@ exports.CustomSizeAndRadius = CustomSizeAndRadius;
|
|
79
83
|
|
80
84
|
var Disabled = function Disabled() {
|
81
85
|
return (0, _react2.jsx)(_["default"], {
|
82
|
-
src:
|
86
|
+
src: _imageConstants.pingImg,
|
83
87
|
isDisabled: true
|
84
88
|
});
|
85
89
|
};
|
86
90
|
|
87
|
-
exports.Disabled = Disabled;
|
91
|
+
exports.Disabled = Disabled;
|
92
|
+
|
93
|
+
var FallbackImage = function FallbackImage() {
|
94
|
+
return (0, _react2.jsx)(_["default"], {
|
95
|
+
fallbackImage: _imageConstants.pingImg,
|
96
|
+
src: "https://deelay.me/7000/https://picsum.photos/150/150",
|
97
|
+
sx: {
|
98
|
+
width: '150px',
|
99
|
+
height: '150px'
|
100
|
+
}
|
101
|
+
});
|
102
|
+
};
|
103
|
+
|
104
|
+
exports.FallbackImage = FallbackImage;
|
105
|
+
|
106
|
+
var WithSkeletonLoadSuccess = function WithSkeletonLoadSuccess(_ref2) {
|
107
|
+
var useLocalSrc = _ref2.useLocalSrc;
|
108
|
+
var imageSrc = useLocalSrc ? _imageConstants.pingImg : 'https://deelay.me/3000/https://picsum.photos/150/150';
|
109
|
+
return (0, _react2.jsx)(_["default"], {
|
110
|
+
src: imageSrc,
|
111
|
+
sx: {
|
112
|
+
width: '150px',
|
113
|
+
height: '150px'
|
114
|
+
}
|
115
|
+
});
|
116
|
+
};
|
117
|
+
|
118
|
+
exports.WithSkeletonLoadSuccess = WithSkeletonLoadSuccess;
|
119
|
+
WithSkeletonLoadSuccess.args = {
|
120
|
+
useLocalSrc: (0, _isChromatic["default"])()
|
121
|
+
};
|
122
|
+
|
123
|
+
var WithSkeletonLoadTimeout = function WithSkeletonLoadTimeout() {
|
124
|
+
return (0, _react2.jsx)(_["default"], {
|
125
|
+
src: "https://deelay.me/7000/https://picsum.photos/150/150",
|
126
|
+
sx: {
|
127
|
+
width: '150px',
|
128
|
+
height: '150px'
|
129
|
+
}
|
130
|
+
});
|
131
|
+
};
|
132
|
+
|
133
|
+
exports.WithSkeletonLoadTimeout = WithSkeletonLoadTimeout;
|
@@ -2,25 +2,82 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
4
|
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
+
|
7
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
8
|
+
|
9
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
10
|
+
|
11
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
12
|
+
|
13
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
14
|
+
|
15
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
16
|
+
|
17
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
18
|
+
|
19
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
20
|
+
|
21
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
22
|
+
|
23
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
24
|
+
|
5
25
|
var _react = _interopRequireDefault(require("react"));
|
6
26
|
|
27
|
+
var _react2 = require("@testing-library/react");
|
28
|
+
|
7
29
|
var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
|
8
30
|
|
9
31
|
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
10
32
|
|
11
33
|
var _ = _interopRequireDefault(require("."));
|
12
34
|
|
13
|
-
var
|
35
|
+
var _react3 = require("@emotion/react");
|
36
|
+
|
37
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
38
|
+
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
40
|
+
|
41
|
+
var testSrc = 'test-src';
|
42
|
+
var testFallbackSrc = 'test-fallback-src';
|
43
|
+
var skeletonImageId = 'skeleton-image';
|
44
|
+
var defaultProps = {
|
45
|
+
src: testSrc,
|
46
|
+
fallbackImage: testFallbackSrc
|
47
|
+
};
|
14
48
|
|
15
49
|
var getComponent = function getComponent() {
|
16
50
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
17
|
-
return (0, _testWrapper.render)((0,
|
51
|
+
return (0, _testWrapper.render)((0, _react3.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props)));
|
18
52
|
}; // Need to be added to each test file to test accessibility using axe.
|
19
53
|
|
20
54
|
|
21
55
|
(0, _testAxe["default"])(getComponent);
|
56
|
+
var fallbackImageObj = null;
|
57
|
+
jest.mock('../../hooks/useFallbackImage', function () {
|
58
|
+
return function (props) {
|
59
|
+
fallbackImageObj = _objectSpread({}, props);
|
60
|
+
return [];
|
61
|
+
};
|
62
|
+
});
|
22
63
|
test('an image is rendered', function () {
|
23
64
|
getComponent();
|
65
|
+
(0, _react2.act)(function () {
|
66
|
+
fallbackImageObj.onImageLoad();
|
67
|
+
});
|
68
|
+
|
69
|
+
var img = _testWrapper.screen.getByRole('img');
|
70
|
+
|
71
|
+
expect(img).toBeInstanceOf(HTMLImageElement);
|
72
|
+
expect(img).toBeInTheDocument();
|
73
|
+
});
|
74
|
+
test('an image is rendered with no fallback', function () {
|
75
|
+
getComponent({
|
76
|
+
fallbackImage: null
|
77
|
+
});
|
78
|
+
(0, _react2.act)(function () {
|
79
|
+
fallbackImageObj.onImageLoad();
|
80
|
+
});
|
24
81
|
|
25
82
|
var img = _testWrapper.screen.getByRole('img');
|
26
83
|
|
@@ -31,8 +88,87 @@ test('image shows disabled status', function () {
|
|
31
88
|
getComponent({
|
32
89
|
isDisabled: true
|
33
90
|
});
|
91
|
+
(0, _react2.act)(function () {
|
92
|
+
fallbackImageObj.onImageLoad();
|
93
|
+
});
|
34
94
|
|
35
95
|
var img = _testWrapper.screen.getByRole('img');
|
36
96
|
|
37
97
|
expect(img).toHaveClass('is-disabled');
|
98
|
+
});
|
99
|
+
describe('test Image component with useFallbackImage hook', function () {
|
100
|
+
test('image component will use src if loaded correctly', function () {
|
101
|
+
getComponent();
|
102
|
+
(0, _react2.act)(function () {
|
103
|
+
fallbackImageObj.onImageLoad();
|
104
|
+
});
|
105
|
+
expect(_testWrapper.screen.getByRole('img')).toHaveAttribute('src', testSrc);
|
106
|
+
});
|
107
|
+
test('image component will use fallbackImg if src loaded with error', function () {
|
108
|
+
getComponent();
|
109
|
+
(0, _react2.act)(function () {
|
110
|
+
fallbackImageObj.onImageError();
|
111
|
+
});
|
112
|
+
|
113
|
+
var img = _testWrapper.screen.getByRole('img');
|
114
|
+
|
115
|
+
expect(img).toHaveAttribute('src', testFallbackSrc);
|
116
|
+
});
|
117
|
+
test('image component will use fallbackImg if src timed out', function () {
|
118
|
+
getComponent();
|
119
|
+
(0, _react2.act)(function () {
|
120
|
+
fallbackImageObj.onFallbackTimeout();
|
121
|
+
});
|
122
|
+
|
123
|
+
var img = _testWrapper.screen.getByRole('img');
|
124
|
+
|
125
|
+
expect(img).toHaveAttribute('src', testFallbackSrc);
|
126
|
+
});
|
127
|
+
test('if image loads after timeout src still be the fallback', function () {
|
128
|
+
getComponent();
|
129
|
+
(0, _react2.act)(function () {
|
130
|
+
fallbackImageObj.onFallbackTimeout();
|
131
|
+
fallbackImageObj.onImageLoad();
|
132
|
+
});
|
133
|
+
|
134
|
+
var img = _testWrapper.screen.getByRole('img');
|
135
|
+
|
136
|
+
expect(img).toHaveAttribute('src', testFallbackSrc);
|
137
|
+
});
|
138
|
+
test('if image loads before timeout src still be the the origin one', function () {
|
139
|
+
getComponent();
|
140
|
+
(0, _react2.act)(function () {
|
141
|
+
fallbackImageObj.onImageLoad();
|
142
|
+
fallbackImageObj.onFallbackTimeout();
|
143
|
+
});
|
144
|
+
expect(_testWrapper.screen.getByRole('img')).toHaveAttribute('src', testSrc);
|
145
|
+
});
|
146
|
+
test('the skeleton loading will appear if no fallback image is given', function () {
|
147
|
+
getComponent({
|
148
|
+
fallbackImage: null
|
149
|
+
});
|
150
|
+
expect(_testWrapper.screen.getByTestId(skeletonImageId)).toBeInTheDocument();
|
151
|
+
(0, _react2.act)(function () {
|
152
|
+
fallbackImageObj.onImageLoad();
|
153
|
+
});
|
154
|
+
expect(_testWrapper.screen.getByRole('img')).toHaveAttribute('src', testSrc);
|
155
|
+
});
|
156
|
+
test('the skeleton will be shown instead of img if no fallback image is given and image load failed', function () {
|
157
|
+
getComponent({
|
158
|
+
fallbackImage: null
|
159
|
+
});
|
160
|
+
(0, _react2.act)(function () {
|
161
|
+
fallbackImageObj.onImageError();
|
162
|
+
});
|
163
|
+
expect(_testWrapper.screen.getByTestId(skeletonImageId)).toBeInTheDocument();
|
164
|
+
});
|
165
|
+
test('the skeleton will be shown instead of img if no fallback image is given and image load timed out', function () {
|
166
|
+
getComponent({
|
167
|
+
fallbackImage: null
|
168
|
+
});
|
169
|
+
(0, _react2.act)(function () {
|
170
|
+
fallbackImageObj.onFallbackTimeout();
|
171
|
+
});
|
172
|
+
expect(_testWrapper.screen.getByTestId(skeletonImageId)).toBeInTheDocument();
|
173
|
+
});
|
38
174
|
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
|
9
|
+
exports.pingImg = exports.chiefIdentityChampions = void 0;
|
10
|
+
var pingImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAkFBMVEW4Iy/////78/O1Ahu3GSfIam+0ABfqx8mzAA+3HiuyAAD25ufkt7rARE22EiK1Ch68LjnWj5TdqqzOd3yzAA357e79+fm9OEHx3d7mvcDszM7FWWDw19nMcHb14+SzABPUi4/HX2bBRk/Zmp7QfYLJZmzeq63CT1fYlpq+PUbdoqbEVFy8Mj3ATFPRg4flury38LwjAAANQklEQVR4nO2d6XaqOhiGwUQgSBNtgTpQ0ao4tfb+726TMIc5WrV75f2zz1KweUhIvik5iiIlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUldSMhDDQCH92K3xPyvw4zPfgw8KNb8kuCiq4yuVvj0W35FeGFqyYK/Ee3plmoTo03HdWcDuBejRUReqnS19dYwZqhAVwNqo3yhOqx8XE8WECt08AZ6cHlbGtlSnwpXjrTHtH0jgKDWsRY8y0GHKM95a555vm0nTCcLl8Jyd+DIH/F+YmXxS6EoQ5+rhvhgv/68sSd2JFQnX5lEHDIfzv5Dw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3MWOPoaEhBQlrNzTbfsWn1ngGlmJDNpKnZlRDyDipdpgUJFcONxibbyyWSQ7qSkMYT0lNIf4WQLus0K8IyG31Ps7oF4bAT4VGckE6hUztKlAja0NcTpqfoJoTUorHec6kTRXimiXaOYMRMtrse3Je8h9+5I2bTuVQLG/WqFdNfooRsQd1CZrLduvywEyE1ND55QrqE8DFYYUIa27UANdnYAZpVB379ipLVgm4qTs4dZwYIbTldnPkz84UJqd03tanxR61uogzvxJgQUvMkgWHvH205dZW4Q6vECdkwZZucQqsbbNT5cneX1zEhZMtUnGcGw2Q2MMJvL8kwheQ6QupHnk9sw3IIejnsdP5Qs18lZPbLFJDQezJZXTJrOeV23xkZsreW1kSYuLS1hNSaOUyZHUiC0+ZFXdwlk5R6Tyyu50wW61WUl41mdBrfdy+hMWy86FFAtpbwCKO5OCME0S0pozZQp5HVTYJLoJ9fvHsYb5mPnz8eyE0cDaSwwPpyyr6kU1ElIXWzdGKOxwVCGrvwsKkk2ZmoUIOa72gfHD7Or3c5jp+aGPHG8a80S0B34cY+BVLSVLuzIPGDSAkT74nNvqoTzcrpuhPZRE56eXS8AJvP8G6P3yZ3SXfCUxDEEQUEo0zPYGse3EFy6Buy17PRYDCafcShw00QnOOBhy9BECXVQBRvoyzEeg3iKYRE+7EviVfGjtWKOi70/NCdLBucJbQQgMPV6qzhcNrMndcLgU9IVjCfu4H+d9I/+Ht1iTbTk+wCjD+TT6nYSR73rvcoKvSxBeOudEWvuhXld7rTSPP8yf/vUNdJs+7rGt5dyHYzB+Z/FKLZjb934nl3QeNH+GyLPyHIjqr+/I/fQhrFcPf/8RgNl8npK/yPe5AKiGYApaSkpKSkpKSkpP6K/gG8zOuuFcJIQAAAAABJRU5ErkJggg==';
|
11
|
+
exports.pingImg = pingImg;
|
12
|
+
var chiefIdentityChampions = 'https://images.pingidentity.com/image/upload/f_auto,q_auto,w_auto,c_scale/ping_dam/content/dam/ping-6-2-assets/images/company/our-company/chief-identity-champions.png';
|
13
|
+
exports.chiefIdentityChampions = chiefIdentityChampions;
|