@telefonica/mistica 10.24.2 → 10.27.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.
- package/CHANGELOG.md +29 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +20 -5
- package/dist/button.js.flow +2 -0
- package/dist/callout.js +37 -26
- package/dist/image.d.ts +3 -0
- package/dist/image.js +35 -4
- package/dist/image.js.flow +3 -0
- package/dist/package-version.js +1 -1
- package/dist/skins/blau.js +0 -2
- package/dist/skins/o2-classic.js +0 -4
- package/dist/skins/o2.js +0 -4
- package/dist/skins/telefonica.js +1 -5
- package/dist/skins/vivo.js +0 -4
- package/dist/tag.d.ts +2 -1
- package/dist/tag.js +33 -3
- package/dist/tag.js.flow +2 -1
- package/dist/text-link.d.ts +1 -0
- package/dist/text-link.js +8 -0
- package/dist/text-link.js.flow +1 -0
- package/dist/text.d.ts +2 -0
- package/dist/text.js +4 -3
- package/dist/text.js.flow +2 -0
- package/dist/utils/analytics.d.ts +6 -0
- package/dist/utils/analytics.js +13 -0
- package/dist/utils/analytics.js.flow +8 -0
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/common.js +11 -1
- package/dist/utils/common.js.flow +1 -0
- package/dist/utils/types.d.ts +1 -7
- package/dist/utils/types.js.flow +1 -7
- package/dist/video.d.ts +2 -0
- package/dist/video.js +37 -5
- package/dist/video.js.flow +2 -0
- package/dist-es/button.js +20 -5
- package/dist-es/callout.js +38 -27
- package/dist-es/image.js +34 -4
- package/dist-es/package-version.js +1 -1
- package/dist-es/skins/blau.js +0 -2
- package/dist-es/skins/o2-classic.js +0 -4
- package/dist-es/skins/o2.js +0 -4
- package/dist-es/skins/telefonica.js +1 -5
- package/dist-es/skins/vivo.js +0 -4
- package/dist-es/tag.js +32 -3
- package/dist-es/text-link.js +8 -0
- package/dist-es/text.js +4 -3
- package/dist-es/utils/analytics.js +6 -0
- package/dist-es/utils/common.js +9 -0
- package/dist-es/video.js +36 -5
- package/package.json +2 -2
package/dist-es/text.js
CHANGED
|
@@ -4,6 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { createUseStyles } from './jss';
|
|
5
5
|
import { useIsInverseVariant } from './theme-variant-context';
|
|
6
6
|
import { pxToRem } from './utils/css';
|
|
7
|
+
import { getPrefixedDataAttributes } from './utils/dom';
|
|
7
8
|
function _defineProperty(obj, key, value) {
|
|
8
9
|
if (key in obj) {
|
|
9
10
|
Object.defineProperty(obj, key, {
|
|
@@ -116,7 +117,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
116
117
|
};
|
|
117
118
|
});
|
|
118
119
|
export var Text = function(param) {
|
|
119
|
-
var weight = param.weight, color = param.color, textDecoration = param.textDecoration, _decoration = param.decoration, decoration = _decoration === void 0 ? textDecoration : _decoration, truncate = param.truncate, uppercase = param.uppercase, transform = param.transform, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'];
|
|
120
|
+
var weight = param.weight, color = param.color, textDecoration = param.textDecoration, _decoration = param.decoration, decoration = _decoration === void 0 ? textDecoration : _decoration, truncate = param.truncate, uppercase = param.uppercase, transform = param.transform, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'], dataAttributes = param.dataAttributes;
|
|
120
121
|
var isInverse = useIsInverseVariant();
|
|
121
122
|
var classes = useStyles({
|
|
122
123
|
isInverse: isInverse,
|
|
@@ -137,12 +138,12 @@ export var Text = function(param) {
|
|
|
137
138
|
return null;
|
|
138
139
|
}
|
|
139
140
|
var className = classnames(classes.text, _defineProperty({}, classes.truncate, !!truncate));
|
|
140
|
-
return(/*#__PURE__*/ React.createElement(as, {
|
|
141
|
+
return(/*#__PURE__*/ React.createElement(as, _objectSpread({
|
|
141
142
|
className: className,
|
|
142
143
|
id: id,
|
|
143
144
|
role: role,
|
|
144
145
|
'aria-level': ariaLevel
|
|
145
|
-
}, children));
|
|
146
|
+
}, getPrefixedDataAttributes(dataAttributes)), children));
|
|
146
147
|
};
|
|
147
148
|
var getRegularOrMediumWeight = function(props) {
|
|
148
149
|
return props.regular && 'regular' || props.medium && 'medium';
|
package/dist-es/utils/common.js
CHANGED
|
@@ -16,3 +16,12 @@ export var combineRefs = function() {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
export var getTextFromChildren = function(children) {
|
|
20
|
+
var text = '';
|
|
21
|
+
React.Children.forEach(children, function(child) {
|
|
22
|
+
if (typeof child === 'string') {
|
|
23
|
+
text += child;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return text;
|
|
27
|
+
};
|
package/dist-es/video.js
CHANGED
|
@@ -3,6 +3,35 @@ import * as React from 'react';
|
|
|
3
3
|
import { useDisableBorderRadius } from './image';
|
|
4
4
|
import { createUseStyles } from './jss';
|
|
5
5
|
import { combineRefs } from './utils/common';
|
|
6
|
+
import { getPrefixedDataAttributes } from './utils/dom';
|
|
7
|
+
function _defineProperty(obj, key, value) {
|
|
8
|
+
if (key in obj) {
|
|
9
|
+
Object.defineProperty(obj, key, {
|
|
10
|
+
value: value,
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
obj[key] = value;
|
|
17
|
+
}
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
function _objectSpread(target) {
|
|
21
|
+
for(var i = 1; i < arguments.length; i++){
|
|
22
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
23
|
+
var ownKeys = Object.keys(source);
|
|
24
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
25
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
26
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
ownKeys.forEach(function(key) {
|
|
30
|
+
_defineProperty(target, key, source[key]);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
}
|
|
6
35
|
function _objectWithoutProperties(source, excluded) {
|
|
7
36
|
if (source == null) return {};
|
|
8
37
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
@@ -56,14 +85,15 @@ var useStyles = createUseStyles(function() {
|
|
|
56
85
|
});
|
|
57
86
|
/** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';
|
|
58
87
|
var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
59
|
-
var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, props = _objectWithoutProperties(_param, [
|
|
88
|
+
var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, dataAttributes = _param.dataAttributes, props = _objectWithoutProperties(_param, [
|
|
60
89
|
"src",
|
|
61
90
|
"poster",
|
|
62
91
|
"autoPlay",
|
|
63
92
|
"muted",
|
|
64
93
|
"loop",
|
|
65
94
|
"preload",
|
|
66
|
-
"aspectRatio"
|
|
95
|
+
"aspectRatio",
|
|
96
|
+
"dataAttributes"
|
|
67
97
|
]);
|
|
68
98
|
var noBorderRadius = useDisableBorderRadius();
|
|
69
99
|
var classes = useStyles({
|
|
@@ -103,7 +133,7 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
103
133
|
} else {
|
|
104
134
|
width = '100%';
|
|
105
135
|
}
|
|
106
|
-
return(/*#__PURE__*/ _jsx("video", {
|
|
136
|
+
return(/*#__PURE__*/ _jsx("video", _objectSpread({
|
|
107
137
|
ref: combineRefs(ref, videoRef),
|
|
108
138
|
playsInline: true,
|
|
109
139
|
disablePictureInPicture: true,
|
|
@@ -116,7 +146,8 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
116
146
|
className: classes.video,
|
|
117
147
|
preload: preload,
|
|
118
148
|
// This transparent pixel fallback avoids showing the ugly "play" image in android webviews
|
|
119
|
-
poster: poster || TRANSPARENT_PIXEL
|
|
149
|
+
poster: poster || TRANSPARENT_PIXEL
|
|
150
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
120
151
|
children: sources.map(function(param, index) {
|
|
121
152
|
var src = param.src, type = param.type;
|
|
122
153
|
/*#__PURE__*/ return _jsx("source", {
|
|
@@ -124,6 +155,6 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
124
155
|
type: type
|
|
125
156
|
}, index);
|
|
126
157
|
})
|
|
127
|
-
}));
|
|
158
|
+
})));
|
|
128
159
|
});
|
|
129
160
|
export default Video;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telefonica/mistica",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.27.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
},
|
|
123
123
|
"dependencies": {
|
|
124
124
|
"@juggle/resize-observer": "^3.3.1",
|
|
125
|
-
"@tef-novum/webview-bridge": "^3.
|
|
125
|
+
"@tef-novum/webview-bridge": "^3.2.1",
|
|
126
126
|
"@telefonica/libphonenumber": "^2.8.0",
|
|
127
127
|
"classnames": "^2.3.1",
|
|
128
128
|
"jss": "^10.6.0",
|